tag:blogger.com,1999:blog-247990603932046872.post864591474692182028..comments2023-03-16T02:22:31.130-07:00Comments on The Happy Engineer: Automated Rotation Backup ScriptAndres Mauriciohttp://www.blogger.com/profile/15268055365730184304noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-247990603932046872.post-35307231070916614962016-09-25T02:28:26.495-07:002016-09-25T02:28:26.495-07:00You could have added a check if the script was exe...You could have added a check if the script was executed with arguments. After editing, I forgot the arguments and it wiped my / partiton :)<br /><br />root@mx1:~# ./backup_rotation.sh <br />[Sun Sep 25 11:18:03 CEST 2016] - Started Backup<br />[Sun Sep 25 11:18:03 CEST 2016] - Backup directory in /09-25-2016/<br />[Sun Sep 25 11:18:03 CEST 2016] - Finished Backup - 4.0K /09-25-2016/ Copied<br />[Sun Sep 25 11:18:03 CEST 2016] - Found outdated backup folder! Deleting directory /usr<br />[Sun Sep 25 11:18:08 CEST 2016] - Found outdated backup folder! Deleting directory /mnt<br />[Sun Sep 25 11:18:08 CEST 2016] - Found outdated backup folder! Deleting directory /media<br />[Sun Sep 25 11:18:08 CEST 2016] - Found outdated backup folder! Deleting directory /srv<br />[Sun Sep 25 11:18:08 CEST 2016] - Found outdated backup folder! Deleting directory /lost+found<br />[Sun Sep 25 11:18:08 CEST 2016] - Found outdated backup folder! Deleting directory /backup<br />[Sun Sep 25 11:18:08 CEST 2016] - Found outdated backup folder! Deleting directory /home<br />[Sun Sep 25 11:18:08 CEST 2016] - Found outdated backup folder! Deleting directory /var<br />[Sun Sep 25 11:18:09 CEST 2016] - Found outdated backup folder! Deleting directory /lib<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-247990603932046872.post-7382182480693421842014-03-01T00:26:07.009-08:002014-03-01T00:26:07.009-08:00Hi zyphlar I've found your comment usefull. So...Hi zyphlar I've found your comment usefull. Sorry for the late reply and great idea for the github!!lordcellohttps://www.blogger.com/profile/08068235410060810063noreply@blogger.comtag:blogger.com,1999:blog-247990603932046872.post-40817887122755886942013-09-22T09:58:54.268-07:002013-09-22T09:58:54.268-07:00Cool! Two problems though, firstly $BACKUPDIR does...Cool! Two problems though, firstly $BACKUPDIR doesn't exist so you create a folder in the root directory unnecessarily. Second, if you run this script without a second argument, it will promptly attempt to delete basically your whole hard drive (rm -rf /bin, rm -rf /home, etc, since they're older than 7 days.) I found this out the exciting way.<br /><br />I've uploaded a modified version to Github for future collaboration/forking/fun: https://github.com/zyphlar/backup-rotation-scriptzyphlarhttps://www.blogger.com/profile/07896508370907297730noreply@blogger.com