Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
General
cancel
Showing results for 
Search instead for 
Did you mean: 

looking for command line for scheduling daily backup

looking for command line for scheduling daily backup

hi,
can some body tell me the command for scheduling daily backup command on linux 5.2 server and linux 7.3 server.

thz
turishi
3 REPLIES
Mark Grant
Honored Contributor

Re: looking for command line for scheduling daily backup

I guess the simplest form is to use "cron". cron is a scheduler that runs things at regular intervals. It takes a file called a crontab file which contains the time and day and month that a program should run and contains the path to the program to run. You edit your crontab file with "crontab -e" and an example would be

# Run daily backup job at 4:40 every day:
40 4 * * * tar cvf /dev/st0 /*

In this example "tar" is used to backup to tape but you would replace this with your chosen method of backing up.

Check out the man page for "cron" and "crontab"
Never preceed any demonstration with anything more predictive than "watch this"
Manuel Contreras
Regular Advisor

Re: looking for command line for scheduling daily backup

If your utilizing omniback, your cell manager's crontab may initiated the backup...

setup an executable shell script containing the following omniback command:

/opt/omni/bin/omnib -datalist DATAlistname

(review omnib man for more info)

if your utilizing tar, that would be setup on the corresponding linux server...

you would need a backup device:

backup dev filesystem
tar cvf /dev/rmt/0m /home/* > /logdirectory/weekly_home.log 2>&1


another option is dump, which I have not tried....checkup man pages.

hope this helps and happy new-year,
manuel
Steven E. Protter
Exalted Contributor

Re: looking for command line for scheduling daily backup

You do this with the at command or for regular jobs cron

crontab -e

edits the cron file.

Here is an example

30 4 * * * /backupscript 2>&1 | mail -s "backup job" youraddress@yourisp.com

This job runs the backup script at 4:30 a.m. every day and mails the output to your email address

crontab -l shows in non-edit mode the users current cron table(schedule).

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com