LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 01-08-2009, 06:44 AM   #1
numtre
Member
 
Registered: Dec 2008
Location: Ireland
Distribution: Ubuntu 8.10
Posts: 45

Rep: Reputation: 15
rsync and cron


hello everyone
I'm trying to setup my backup

I was thinking of writing a script like
sudo rsync -av MYUSERNAME /media/BACKUPDISK/rsync

then put it into cron daily

would it make sense?
What happens if my external hard drive is not connected?
What time does the daily cron start?

Is it possible to make a script so that my backup runs whenever I connect my ext HD, unless its been run in the last hour? Can you point me in the right direction? No need for a tutorial if you're in a hurry, a webpage will do

Thanks a lot!
 
Old 01-08-2009, 06:54 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,500

Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
Quote:
What time does the daily cron start?
You can set cron at the hour you want
see man cron

Quote:
sudo rsync -av MYUSERNAME /media/BACKUPDISK/rsync
nake a cronjob for the user
you can make a cronjob for the user
as user:
crontab -e

You can add a verification to your script to see if the drive is connected at the time the script is executed.

# Lets see ithe HD is connected, if not quit
if mount | grep BACKUPDISK > /dev/null
then
rsync -av /media/BACKUPDISK/rsync
else
echo "No or wrong external HD connected"
echo "Please verify"
echo "Nothing to do here, so quitting"
exit 1
fi
 
  


Reply

Tags
cron, rsync


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
Need coaching with RSync and cron configuration on Ubuntu mkenyon2 Linux - Software 4 12-17-2008 03:09 AM
Auto RSYNC Over SSH via Cron? carlosinfl Linux - General 1 09-10-2007 02:12 PM
Cannot execute rsync as a cron job jdaniels73 Linux - Software 2 09-03-2006 05:03 AM
how do I rsync & cron to fetch -current weekly? chess Slackware 3 09-11-2005 10:07 AM
using rsync with cron & pub. key kmitz Fedora 0 01-14-2005 08:01 AM


All times are GMT -5. The time now is 04:07 PM.

Main Menu
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