Forum Moderators: bakedjake

Message Too Old, No Replies

Crontab step-by-step help needed

backing up or emailing a file

         

davighi

4:37 pm on May 28, 2003 (gmt 0)



Yesterday I lost the one essential file on my server. And yes I hadn't backed it up for three weeks. After much grovelling to my host administrator he reinstated it from their back up copy, phew!

He suggested I set up a cron job to back up or email this file each night.

Can anyone help with a step-by-step guide? example crontab files, etc. As you can probably tell I know very little about this.

marcs

4:43 pm on May 28, 2003 (gmt 0)

10+ Year Member



Welcome to WebmasterWorld.

If the file is a simple text file, a simple crontab entry will do :

0 0 * * * mail you@your_email.com < /path/to/your/file

That would email the file to you each day at midnight.

This would not work for binary files, if memory serves.

dingman

9:59 pm on May 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



for binary files, you could try:

0 0 * * * mpack -s "subject-line" -m 0 /path/to/your/file you@your_email.com

quick testing shows that works on one of my systems. Of course, you have to have mpack installed on the server, and it's not quite as ubiquitous as 'mail'.

littleman

10:17 pm on May 28, 2003 (gmt 0)



Air did a great HOWTO a couple of years ago:
[webmasterworld.com...]