LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-06-2004, 01:57 PM   #1
cbeach512
LQ Newbie
 
Registered: Jan 2004
Posts: 1

Rep: Reputation: 0
Question cron script backups


I have several linux servers that I want to backup using cron scripts. I was thinking of something along the lines of each computer running a script to tar the vital data and then my backup computer running a cron script to fetch those files. I already have a backup that runs on that computer. It backs up nightly to tape and currently just backs up the user computers on the network. I am not familiar enough with linux to write anything more that the local tar scripts. How do i setup the script to pull the files through the network to the backup computer? Or better yet does anyone have a sample script they can send me that i can modify. Thanks for the help.
 
Old 01-06-2004, 03:00 PM   #2
Gates1026
Member
 
Registered: Sep 2003
Location: Iowa
Distribution: Slackware 9.1
Posts: 155

Rep: Reputation: 30
Well here is what I would do:
1.) Make a file that has all of the commands you want to perform at the same time
- ex: make a script called nightly_backup (give it executable permissions)
2.) Make your crontab file (ex: cron_file)
- This file is used by the crond process to tell it what times you want to run your scripts
- This file could look like this
##################################
## Nightly backup cron file

30 02 * * * /home/user/nightly_backup
###################################

then do (as root) # crontab cron_file
This will execute the script /home/user/nightly_backup every night at 2:30 AM

Then all you need to do is make your script nightly_backup and have it perform the functions that you want it to.

I would reccomend that you have ssh setup for every server. Also you will want to have your ssh set up so that you do not need passwords for the users (to make scripting much easier). If you dont know how to do that, we can work with that. Then you would setup your tar statements after you ssh to the server, use scp to copy the files back to your backup server and that should be it (maybe make a log of the process).
 
  


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
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 09:09 AM
Script that automates backups using ftp linuxmandrake Programming 4 11-25-2005 06:12 PM
PPPD Script problem when cron-scheduling the script andresurzagasti Linux - Networking 0 11-24-2004 03:54 PM
Cron script help mpls mikeg Linux - Software 2 09-24-2004 10:28 AM
cron backups kenji1903 Linux - Software 5 05-31-2004 12:04 AM


All times are GMT -5. The time now is 10:44 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration