LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 07-11-2006, 10:58 AM   #1
FreezEy
LQ Newbie
 
Registered: Dec 2005
Posts: 26

Rep: Reputation: 15
Simple Cron Job question


I have a pretty decent size windows network... its got a bunch of servers with alot of information that normally i was running a simple batch file on a windows machine and backed everything up to some windows dir.... recently i started installing a bunch of linux machines( ubuntu slackware) and now i want to backup all the windows machines to this slackware server i made....

I have samba running everything is cool all the computers talk to eachother they seem to like eachother so i have no problem with the networking...

30 0 * * * thats the time interval for cronjob i am looking to use...

now what i want to do is backup everything i was backing up with the windows machine to the linux machine... just new to cron so i have no idea what kind of script to write for this...

example is: (for one of the server names)
(blue is the dir we are gonna backup to linux server)
\\server2\blue (where does this go how do i direct it just not sure)

You can post here or i am on AIM also Terrorizr2 ... if u think talking would help me out a bit more... thanks
 
Old 07-11-2006, 12:01 PM   #2
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,244

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
I'll give you a pointer, not a complete HOWTO.

Usually it is recommended to write a bash script to do whatever you want to do, and call the bash script from cron. In my signature there is the URL of the Bash Scripting manual, in there you'll also find some tips for converting DOS scripts to Bash scripts. If you do only file copying it is very easy.

Then, I assume you have some Samba drives mounted in your Linux machine. You either want to backup from a Windows machine to a Linux machine, or from a Windows machine to another Windows machine.

If you have mounted your Samba drive on the Linux machine, you mostly find it back in /mnt, so:
/mnt/server2
Once the drive is mounted, you'll find the subdirectories there.

A copy action is something like:
cp /mnt/server2/blue/* /mnt/server1/blue_backup/.
from one Windows machine to another, or
cp /mnt/server2/blue/* /home/backup/blue_backup/.
to this Linux machine.

However, for backups etc, it is much better to use rsync. You can use rsync locally, that is from one drive in the file system, say /mnt/server2/blue, to another mounted drive, say /mnt/server1/blue_backup

rsync is very powerful, and has a zillion modes and options. Do check the man page and run a few tests before you bring it in the production environment.

jlinkels
 
Old 07-11-2006, 12:49 PM   #3
FreezEy
LQ Newbie
 
Registered: Dec 2005
Posts: 26

Original Poster
Rep: Reputation: 15
backing it up this way does it overwrite the previous backup? or continue to make another folder for each time it backs it up>?
 
Old 07-11-2006, 02:30 PM   #4
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,244

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
man cp
man rsync
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
simple cron job: not working Robert0380 Linux - Software 3 06-24-2008 05:45 AM
Cron Job Question tarballed Linux - Newbie 4 06-20-2006 04:39 PM
Cron Job Question abhijeetudas Linux - Software 2 03-02-2006 12:27 AM
how to make a simple code for just restarting Apache via a Cron job hsa Programming 1 08-22-2005 05:15 AM
Quick Question about cron job andy18 Linux - General 2 08-11-2003 05:16 PM


All times are GMT -5. The time now is 07:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration