plbackitup.pl FAQ and Help Last updated 03/02/2001 Get the most current version from the website: http://www.glandrake.com/scripts.html 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. ================== ================== Q: I was running v0.4, and now v0.x but I keep getting the error "No backup_list specified. Exiting." A: I made a change to the way plbackitup used the backup_list file. The /path/backup_list is now passed through ARG[0], which means the file is specified in the command line. example: /tmp/backup/plbackitup.pl /tmp/backup/backup_list I changed this to allow for different backups during the day, without having to run multiple copies of the script. Now you can use a different backup_list for different backup jobs. Example: Cron to run at 3:00pm /tmp/backup/plbackitup.pl /tmp/backup/backup_web_stuff Cron to run at 11:00pm /tmp/backup/plbackitup.pl /tmp/backup/backup_user_stuff ================== ================== Q: I run a backup twice a day on the same files, and my files are being overwritten. Help! A: Ok try this: (for v0.5 to current) Set $delete_old_files = 3, and check $date_check (default is 10). What this will do is allow you to pass another ARG value ARG[1] to the script to make the filename more unique. Lets say you have only the line webBackup:/usr/local/apache: In your backup list /tmp/backup/backup_web_stuff. Cron to run at 3:00pm /tmp/backup/plbackitup.pl /tmp/backup/backup_web_stuff 300pm Cron to run at 11:00pm /tmp/backup/plbackitup.pl /tmp/backup/backup_web_stuff 1100pm This will insert "300pm" and "1100pm" into all the filenames backed up at the time the script is run, i.e.: 23Feb2001-300pm-webBackup.tgz and 23Feb2001-1100pm-webBackup.tgz Running like this will allow you to keep 10 of all files matching "*webBackup.tgz". So if you run the config above twice a day, after 5 days, you will have 10 files. ================== ================== Q: I am emailing myself the log but I keep getting 2 emails that are different, but from the script. A: Run your cron like this with a " > /dev/null 2>&1" on the end: 0 5 * * * /tmp/backup/plbackitup.pl /tmp/backup/plbackitup_list > /dev/null 2>&1 Above would run it at 5:00am. If you wanted to run several during the day: 0 5 * * * /tmp/backup/plbackitup.pl /tmp/backup/plbackitup_list backup1 > /dev/null 2>&1 0 12 * * * /tmp/backup/plbackitup.pl /tmp/backup/plbackitup_list backup2 > /dev/null 2>&1 0 20 * * * /tmp/backup/plbackitup.pl /tmp/backup/plbackitup_list backup3 > /dev/null 2>&1 This would run it at 5:00am, 12:00pm, and 8:00pm and insert the characters backup1, backup2 and backup3 into the filenames respectively. These of course can be anything you want them to be (but no weird characters like !@#$%^&*(){}":;'][ etc.....) ================== ================== Q: I don't understand the plbackitup_list file format. A: The list has 3 parts to it: PartialFileName:/DirectortToBackUP:exclude1 exclude2 etc.. Partial File name: This is the name what will be inserted into the back file. If you put 'etcBackup' as the Partial File name, then the backup file will be called something like 23Feb2001-etcBackup.tgz Directory to backup: This is the directory structure to back up, ex: /var/log or /etc Exclusions: These are character matches that "tar" actually uses. If you enter home:/home:ftp in the plbackitup_list file, then everything in /home will be backed up. but will exclude anything matching "ftp" including directories. ================== ================== Q: Not all the files backed up being sent to the FTP server. A: I raised the default timeout for the FTP connection to 600 seconds in v0.5.1. If you are transferring very big files or have a slow network connection to the FTP server you can try upping this value more. This value is an absolute timeout value, not just the connection timeout value. So if you set it to 3600 (1 hour) and the FTP server is not available, it will time out after 1 hour. On the other hand if you set it to 120 (2 minutes) and it takes 5 minutes to connect and transfer the files, it connection will be dropped after 2 minutes and not finish the transfer. So it is better to set it higher rather than lower. Also check the output in the log/console screen to see where it is erroring (v0.7.0 and up)