UNIX for Advanced & Expert Users

Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

Rsync - delete extra files in Destination without synchronising directories

👤 Login to reply

Old 07-05-2017
Catullus Catullus is offline
Registered User
Join Date: Jan 2012
Last Activity: 23 November 2017, 8:57 AM EST
Location: London
Posts: 17
Thanks: 1
Thanked 0 Times in 0 Posts
Rsync - delete extra files in Destination without synchronising directories

I have a script that synchronises a directory to a DR server, but to improve the time, I actually use rsync to transfer files *[123] in one batch and also
*[456] in another batch - both batches run from the same script and run in the background.

My problem is that there isn't much space on the Destination, so I would like to start by deleting any files on there that don't exist on the Source.

Is there any way to delete files on the Destination that don't exist on the Source only i.e. without synchronising the files?

Thanks in advance
Sponsored Links
Old 07-05-2017
zaxxon's Unix or Linux Image
zaxxon zaxxon is offline Forum Staff  
code tag tagger
Join Date: Sep 2007
Last Activity: 6 July 2018, 8:04 AM EDT
Location: St. Gallen, Switzerland
Posts: 6,574
Thanks: 178
Thanked 569 Times in 483 Posts
I doubt rsync can just delete on the target without any sync.
Though there is a --delete-before option that might give you the needed place before it copies.
Sponsored Links
👤 Login to reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Rsync not deleting destination files/folders Chenchireddy UNIX for Dummies Questions & Answers 3 10-07-2014 12:23 PM
Rsync error while running from destination to source lovelysethii UNIX for Advanced & Expert Users 0 08-23-2013 01:12 PM
Rsync not deleting files on destination gmccarthy Shell Programming and Scripting 0 07-12-2012 03:54 PM
[BASH] rsync - error on destination PaganoM Shell Programming and Scripting 0 03-20-2010 06:59 AM
rsync: taking advantage of files in different directory other than destination rssrik UNIX for Advanced & Expert Users 1 05-06-2008 07:35 AM

All times are GMT -4. The time now is 04:53 PM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
Show Password

Not a Forum Member?
Forgot Password?