Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automated backups using CRON

Status
Not open for further replies.

sproosy

IS-IT--Management
Oct 31, 2002
94
AU
Hey dudes,

I have installed and configured Smaba so i can backup important development files from my 2000 server to a tape drive on my solaris 8 machine.
I was wondering if any could advise me on how to setup cron to do a weekly backup of my development files.

Is this easy to do?

Thanks heaps!
long live unix! - Windows crashes too much!!!!! Sproosy MCP

Keep it real!
 
In unix type crontab -e
Hopefully you have an editor set up for this most likely vi.

Add this line to the crontab file.

00 12 * * 7 /directory/commandtorunthebackup 2>&1 > /dev/null

It will run job at 12:00 on sunday.

I'm far from a unix guru at the momment so take my advice with a large pinch of salt.

Chris
 
One way would be to use smbmount to mount your windows share somewhere on your Solaris filesystem. Then you could use the standard backup tools such as tar or cpio to back up that filesystem to tape. I'm not sure whether smbmount works for Solaris though as it doesn't seem to be included in the SunFreeware package. Perhaps you could try compiling it yourself.

Alternatively you could just use smbclient. Add a cron job as Chris described above containing something along the lines of:

[tt] mkdir /lotsofspace/tempbackupdir
cd /lotsofspace/tempbackupdir
smbclient //windowsbox/share << HERE
recurse
prompt
mget *
HERE
tar cvf /dev/rmt/0 /lotsofspace/tempbackupdir
rm -r /lotsofspace/tempbackupdir[/tt]

You may want to change the /dev/null in Chris' posting to a log file somewhere so you can monitor the success or failure of the backup. Annihilannic.
 
Thanks heaps for your contibution guys. I just have one more query, I want to use SMBTAR and i want it to rewind the tape evertime it starts a backup. SHould i just use

mt rw

??

Cheeeers! Sproosy MCP

Keep it real!
 
If you use /dev/rmt/0 as your backup device it will automatically rewind the tape after each backup. /dev/rmt/0n on the other hand, wouldn't. The 'n' stands for 'no rewind'.

If you want to make sure it's rewound just before each backup then mt rewind would do the job. Annihilannic.
 
excelent! Thank you very much i have just set up the cron job, and it works like a dream! You have been very helpful. Thankyou! Sproosy MCP

Keep it real!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top