Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 06-30-2004, 11:03 AM   #1
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 // /mnt/new_projects -o username=tux%penquin
if [ $? = 0 ]
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
echo "Could not mount $sharename on $ip"
echo "Rsync did not transfer any data at this time."
exit 1
Old 06-30-2004, 11:21 AM   #2
Senior Member
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 58
How about --delete-after
Old 06-30-2004, 11:35 AM   #3
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.


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 02:37 AM
Problem with data backup using rsync and samba coolamit78 Linux - Networking 0 10-31-2004 10:01 AM
rsync not deleting bwilliam79 Linux - Software 1 10-04-2004 06:22 PM
Rsync to mirror data for backup - having difficulties tapanga Linux - Newbie 1 05-17-2004 06:45 PM
deleting data from ppp network control patrickfreen Red Hat 2 10-13-2003 11:15 PM

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

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