LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 09: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, 11:01 AM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
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, 11:49 AM   #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, 01:30 PM   #4
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
man cp
man rsync
 
  


Reply



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 04:45 AM
Cron Job Question tarballed Linux - Newbie 4 06-20-2006 03:39 PM
Cron Job Question abhijeetudas Linux - Software 2 03-01-2006 11:27 PM
how to make a simple code for just restarting Apache via a Cron job hsa Programming 1 08-22-2005 04:15 AM
Quick Question about cron job andy18 Linux - General 2 08-11-2003 04:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:40 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
Open Source Consulting | Domain Registration