Sidebar: Using crontab to Start Backups Automatically
crontab is simple to use -- just be sure to specify
the
full paths of the commands in scripts to be invoked.
For example,
for crontab a script would invoke /bin/tar rather
than tar. The $PATH environment variable is set differently
when crontab starts a process.
To update crontab, enter crontab -e. In the resulting
vi session, move to the bottom of the file and add a
line
such as the following:
30 22 * * * /bin2/autoback
Then, enter :wq to implement the update. This
example starts the autoback script found in the /bin2
directory at 10:30 pm every day.
crontab checks for jobs once every minute. You can test
its
functioning as follows. Suppose the time is 9:45 and
you are on tty23.
Enter the command
46 9 * * * echo 'testing 1-2-3' >/dev/tty23
Then enter :wq before the date changes to 9:46.
Watch for the message testing 1-2-3 to appear on your
screen. Don't
forget to delete the line after your test is finished!
For more information
try man crontab.
|