01.21
I wrote a script that does the following on a unix clone, in this case this webserver heh:
- runs in manual or non-manual (eg cron) mode, configurable in a variable.
- pulls the content of a (configurable) directory into a tar archive, compresses it on the fly with gzip and stores it in another (configurable) directory.
- detects if the run is the first one (eg backup is mandatory) otherwise it checks to see if the configured directory that should be backed up has changed size. If it has, the script will backup the dir, otherwise it won’t.
- detects the size of the backup, and will write a warning if the size of the target dir is less than twice the size of the backup, and will write an error and fail if the size of the target dir is equal or less than the estimated size of the backup.
- has a a lock file scheme, eg prevents the script starting while another instance of it is running
- has an email scheme, ie you get a “backup was successful || failed miserably” email to a mailbox you configure in the script.
to do:
-do something snazzy when run in manual mode to show the user that the script is actually still running hehe
-implement passwordless scp copy to a configured remote machine…..maybe
only took me about an hour and a half to write, which I felt pretty good about considering the last time I wrote something is nearly a year ago. good to see I still have it in me heh
ps. nurd!


