John Schneiderman wrote:
On Sunday 25 September 2005 20:23, Michael Hahn wrote:
I'm trying to have my server (Mandrake 10.1) run a backup each night to
CD-R. What I would like to do is put each night's backup in a directory
labeled with the date. All of the how to's I've found describe how to
write a full CD from the command prompt, but not something like I want
to do. Also (showing just how new I am to Linux) I need some help
setting up a script to run each night - I know it can be done, I'm just
not sure how to go about it.
How to run a script:
As root type crontab -e
Press the i-key to enter insert mode,
Then enter the job you want to run as:
Minute Hour Day Month DayOfWeek Command
Once you are done with that press the escape button.
Then type
:wq
followed by enter and you've now set up a job to run when you say to.
John
For system jobs like backups, I like to create a script and put it in
/etc/cron.daily instead. As far as creating a directory with the date,
you can do it using the date command to generate the date. Something
like this:
DATE=$(date +%F)
cd /backup
mkdir $DATE
You can then backup your files, putting them in $DATE, (or
/backup/$DATE) and then build your CD image and burn it. If you want
your DATE directory in a different format, look at the date man page.
(man date)
Mikkel
--
Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!
____________________________________________________
Want to buy your Pack or Services from Mandriva?
Go to http://store.mandriva.com
Join the Club : http://www.mandrivaclub.com
____________________________________________________