tar-cron.php
build tar command-lines for use in cron |
|||
This web-page (tar-cron.php, actually it's a PHP program)
is designed to help with the construction
of tar command-lines for use in your cron
and can be used for contemporal tar execution.
The tar program is an archiver tool. The cron program runs scheduled jobs. |
|
||
tar-cron.php is free to use. Please enjoy.Just Add Common SenseYou alone are responsible for your life. Please use with wisdom. TAR-CRON.PHP IS FOR PRIVATE USE ONLY. COMMERCIAL USE OR REDISTRIBUTION IN ANY FORM, PRINTED OR ELECTRONIC IS PROHIBITED. Copyright © 2003 John G. Derrickson All Rights Reserved JGD@freeVEDA.org |
generated command-lines
WARNINGS: |
monthly generated command-line: (a full backup) |
---|
10 0 1 * * tar -cvzSf /-monthly.tar.gz |
weekly generated command-line: (backup files changed since last monthly) |
20 0 * * 0 tar -cvzS -N /-monthly.tar.gz -f /-weekly.tar.gz |
daily generated command-line: (backup files changed since last weekly) |
30 0 * * * tar -cvzS -N /-weekly.tar.gz -f /-daily-`date +%Y%m%d`.tar.gz |
all together: |
Notes: Be sure a weekly backup exists before making a daily backup and a monthly backup exists before making a weekly backup. So, to get the cycle started, run at the console command prompt the monthly command followed by the weekly command. tar -cvzSf /-monthly.tar.gz tar -cvzS -N /-monthly.tar.gz -f /-weekly.tar.gz Copy-and-paste the shell lines and build the shell file. Copy-and-paste the three command-lines into your cron file and run crontab. For safekeeping, you should copy the archives from the server to another computer: /-monthly.tar.gz /-weekly.tar.gz /-daily-*.tar.gz (note: * is date as yyyymmdd) You should inspect the log files e-mailed to you. Be certain there is enough disk space to store the archive files. Don't try to backup all server files -- concentrate on directories that hold your web-page files and your program files. |