Readme for plbackitup.pl Why I wrote this script: I have been using Linux for about 10 years, and have no tape backup drive, my CD-RW is in my Wind*ws machine, and I wanted an easy way to back up some directories and files. After searching sites, and not finding one I liked I decided to write one. This is it. This script does a bunch of things: Uses a flat-file database to get its backup directory structure Allows no logging, minimal logging, or verbose logging Allows the log to be emailed Gives you the choice to delete old backup files in the backup directory Other stuff is listed below. I suggest keeping only the backup files created by this script in the backup directory, so nothing accidentally gets deleted that you want to save. Although I have tested this, use it AT YOUR OWN RISK! To use the Perl FTP module download and install the libnet module from www.perl.com under CPAN - Modules (or try the link below) Tested with http://www.perl.com/CPAN-local/authors/id/G/GB/GBARR/libnet-1.0703.tar.gz To use the scp function, you need to have ssh installed on the machine running the plbackitup script, and ssh installed on the remote server your copying the files over to. You can download ssh from www.ssh.com Tested with ssh-1.2.30.tar.gz More info is in the script on how to configure this option. Other Info/Instructions are commented in the plbackitup.pl script. I highly suggest testing the script with your changes prior to running it as a cron job, especially if you are going to use the "secure copy" option. Non Related: I know I suck at spelling. When I see an error I will try correct it ;-) ** If you have something you want added let me know. ============================= Change Log ============================= v0.8.4 Forgot to change the version number since v0.8.1 ( /bonkself ) Should display the proper version now in the log. v0.8.3 Changed the header licence to allow distributing modified source with written permission. v0.8.2 Bug fix. Had wrong file extension var in the routines to remove old files. v0.8.1 Bug fix. Since the new file extension for dB files backed up is .gz , those files wouldn't be FTP'd or removed if the script is set to delete files. v0.8.0 Added the ability to backup MySQL DataBases. See the dB Vars section in the script, and the sample plbackitup_list file shows the format. To test and see a dB list run ./plbackitup.pl --testsql Added an option for passive ftp xfers in the ftp Vars section. v0.7.0 Fixed a bug which was not allowing scp to copy all the backup files in the dir if that option was selected. Also an error which was copying all the dated files instead of only the ones just backed up. Added FTP and SCP output to the screen for when the script is run manually. Also added the output to the log file. (I like to see what's going on ;-) ) Moved the FTP debug value to a variable at the top in the VARs section. Added a better format check for the backup_list file which will error is an invalid line is found to for smoother operation. Will also display the number of invalid lines. This includes empty files and directories. Added the format output when an invalid format (ARG) is entered or the script is run with no arguments. Added an option to test the date command and format which is used for deleting older backup files. Grouped the VARS section and cleaned it up. v0.6.0 Added output when running from the command line. Got rid of the annoying "tar removing leading /" msg. Got rid of the annoying "no such file" error which happened the first time the script was run, and the option to delete files was enabled. Fixed a small bug in the routine for keeping the amount of backup files for so many days. It was deleting the file from todays backup and then writing the new backup file. Now it just overwrites the file and it is noted in the screen output as such. Rewrote the routine for deleting old files when using ARG[1] unique name for multiple backups in one day to use the same format as the other delete routine. This now keys off the date stamp in the file name rather than the actual file date/time stamp. Both routines for deleting files older than so many days now use the same VAR $date_check, so the old VAR $keep_number has been removed and the in script comments updated. v0.5.2 Changed the options in the date format to use +%d%b%Y (so day of month is "01" and not "1") Changed $keep_number = 10 as the default, which is better if you run a backup twice a day with $remove_old_files = 3 Started including a FAQ file for a little more help v0.5.1 Fixed a bug which was not allowing the option "FTP ALL the files" to work, it was adding the path twice. Made the $ftp_timeout default to 600 seconds. v0.5 Added the option to copy ALL the files with the extension $file_end to either the FTP server or to the host using scp. Added the VAR $ftp_timeout to allow a higher absolute timeout when connecting to an FTP server. Changed $backup_list to get the file name from $ARGV[0] Changed $unique_name to get the value from $ARGV[1] (optional) Usage format is now /path/plbackitup.pl /path_to/backup_listname [unique_name] Added check for characters other than [a-zA-Z0-9_\-] for the partial filename and path to back up and for proper line format. v0.4 Added The $ENV{"PATH"} so it runs correctly as cron Added an option to scp (secure copy) files to a remote server running ssh w/logging. v0.3 I forgot to uncomment a line in the keep_date routine that actually Deleted the old Files. Added an option to FTP the files to a server w/error logging Cleaned up the log output to be easier to read v0.2 Added the option to keep files for x days before they are deleted. Added the option to keep files who's name partially matches the file name listed in plbackitup_list for X number of days. This is dependent on the date stamp the file name. Good for those who run the script once a day. Added the option to keep files based on "Age" rather than file name. Also for this Added an ARGV option to allow more unique filenames for people who want to run the script multiple times a day. This way the file is not over written. Fixed bug to check if the log exists before mailing. Changed the Date format routine to use options for `date` v0.1 Initial Release ##### end #####