LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 06-30-2004, 10:03 AM   #1
skyfly
LQ Newbie
 
Registered: Apr 2004
Location: Johannesburg, South Africa
Distribution: Redhat Fedora Slackware
Posts: 7

Rep: Reputation: 0
Question How can I stop rsync from deleting data if network link is dropped?


I run rsync as a cron job on a Slackware 9 box. I use smbmount to mount a Windows share and then sync data using rsync with the --delete switch. Sometimes the connection drops while rsync is still running, resulting in the rest of the data being deleted. Is there a way of stopping this to happen? My script looks like this:

umount /mnt/new_projects
smbmount //192.168.0.12/repl /mnt/new_projects -o username=tux%penquin
if [ $? = 0 ]
then
rsync -a -t -r -u -z \
--modify-window=10 \
--ignore-errors \
-v --progress \
--timeout=0 \
--stats \
--delete \
--include "*/" \
--include "*.par" \
--include "*.asm" \
--include "*.cfg" \
--exclude "*" \
--exclude "Visualization/" \
/mnt/new_projects/ "/disk1/Projects"
umount /mnt/new_projects
chmod -R 777 /disk1/Projects
echo Finished at &date
exit 1
else
echo "Could not mount $sharename on $ip"
echo "Rsync did not transfer any data at this time."
exit 1
fi
 
Old 06-30-2004, 10:21 AM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
How about --delete-after
 
Old 06-30-2004, 10:35 AM   #3
skyfly
LQ Newbie
 
Registered: Apr 2004
Location: Johannesburg, South Africa
Distribution: Redhat Fedora Slackware
Posts: 7

Original Poster
Rep: Reputation: 0
Thumbs up Rsync

Thanks. I read up on it, but many people seems to have a problem with it. However, I will try it on my side and see what it does.
 
  


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
DISCUSSION: Using rsync to mirror data between servers david_ross LinuxAnswers Discussion 8 03-29-2012 01:37 AM
Problem with data backup using rsync and samba coolamit78 Linux - Networking 0 10-31-2004 09:01 AM
rsync not deleting bwilliam79 Linux - Software 1 10-04-2004 05:22 PM
Rsync to mirror data for backup - having difficulties tapanga Linux - Newbie 1 05-17-2004 05:45 PM
deleting data from ppp network control patrickfreen Red Hat 2 10-13-2003 10:15 PM


All times are GMT -5. The time now is 01:18 AM.

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