Unix/Linux Go Back    


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

UNIX for Advanced & Expert Users


Tags
rsync

Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 07-05-2017   -   Original Discussion by Catullus
Catullus's Unix or Linux Image
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
    #2  
Old Unix and Linux 07-05-2017   -   Original Discussion by Catullus
zaxxon's Unix or Linux Image
zaxxon zaxxon is offline Forum Staff  
code tag tagger
 
Join Date: Sep 2007
Last Activity: 21 February 2018, 7:14 AM EST
Location: St. Gallen, Switzerland
Posts: 6,574
Thanks: 178
Thanked 568 Times in 482 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
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 01:23 PM
Rsync error while running from destination to source lovelysethii UNIX for Advanced & Expert Users 0 08-23-2013 02:12 PM
Rsync not deleting files on destination gmccarthy Shell Programming and Scripting 0 07-12-2012 04:54 PM
[BASH] rsync - error on destination PaganoM Shell Programming and Scripting 0 03-20-2010 07:59 AM
rsync: taking advantage of files in different directory other than destination rssrik UNIX for Advanced & Expert Users 1 05-06-2008 08:35 AM



All times are GMT -4. The time now is 06:16 AM.