Sponsored Content
Top Forums UNIX for Advanced & Expert Users Rsync - delete extra files in Destination without synchronising directories Post 303000152 by Catullus on Wednesday 5th of July 2017 08:44:13 AM
Old 07-05-2017
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
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

delete pattern files in sub directories

Hello friends, I am compiling some set of SQL scripts in a set of sub directories demoed as below. After compiling log files are being created. Each and every time after compiling time I had to go subdir by subdir to delete the log files. I am sure there should be simple way to look for all log... (4 Replies)
Discussion started by: adurga
4 Replies

2. UNIX for Advanced & Expert Users

rsync: taking advantage of files in different directory other than destination

Dear Folks, I have to backup pgsql database dump everynight on a routine. The database dump actually contains sql(text) statements. The actual size of the database dump is aroung 800 MB. Between two days backup, only few lines of statements are modified/added/deleted. I dont want to do... (1 Reply)
Discussion started by: rssrik
1 Replies

3. Shell Programming and Scripting

[BASH] rsync - error on destination

Hi everyone, and thanks to all for your assistance. I have a problem with the rsync command. I want to make a backup of a "source" directory in a "destination" directory. I want to specify: "absolute path of destination" (identified by a ~): ~/Destination or a "relative path of... (0 Replies)
Discussion started by: PaganoM
0 Replies

4. Shell Programming and Scripting

rsync delete specific files - from different target folder

Hi, I need to use rsync to delete multiple files(only specified files not all) using --delete option, these files are located in different target folders. Instead of running rsync command multiple times for each file, can we achieve this with one time execution? your help is much... (0 Replies)
Discussion started by: MVEERA
0 Replies

5. Shell Programming and Scripting

Rsync not deleting files on destination

I've got a rsync script that backups file from disk1 to disk3. This works great however if there are extra files on disk3 they do not get deleted by the sync. I'm syncing all folders from F-J rsync --progress -v --delete --delete-excluded -av --recursive /home/disk1/Files/*... (0 Replies)
Discussion started by: gmccarthy
0 Replies

6. Shell Programming and Scripting

Is rsync --delete on some files without write permission possible?

Hello all, I have a problem with rsync command. From a backup server, I use a command like the one below: rsync -av --delete user@host:/home/user/ /home/backup_user/daily_rotating_backup/ In some folders of the user there are some files on which he has removed his write permission on... (3 Replies)
Discussion started by: freddie50
3 Replies

7. UNIX for Advanced & Expert Users

Rsync error while running from destination to source

hi All, i have 2 server setup now for Rsync, i configured Rsync on both of the server and it worked well when i did run from source to destination. and while running back from destination to source it produced this error: bash-3.2$ ksh rsync_bravo_db.ksh usa0300uz1247.apps.mc.xerox.com... (0 Replies)
Discussion started by: lovelysethii
0 Replies

8. UNIX for Dummies Questions & Answers

Rsync Can I delete .NFS and .fuse files

Hello, I have some files in a local directory and perform an rsync command with the files in a remote directory, Now when I checked the files in the local and the remote directory, I found some strange filetypes such as this: .nfs0000000001d0c8e000002ff2 , .fuse_hidden000014da00000001 etc etc,... (3 Replies)
Discussion started by: ajayram
3 Replies

9. Shell Programming and Scripting

Delete files in group of directories

OS: SUNOS 5.10 i386 Hello guys I wrote a shell script in bash shell to delete the files less than 30 days old. The following is the script. ======================================= #!/bin/bash for dirs in `/clu04/oracle/directory_list.lst` do find $dirs -type f -mtime -30 -exec rm {} \;... (3 Replies)
Discussion started by: zacsparrow
3 Replies

10. UNIX for Dummies Questions & Answers

Rsync not deleting destination files/folders

Hi All, I want delete all files from destination folder. I am trying below commands rsync -avFF --delete-after /home/vizion/source/ /home/vizion/destination/ I need to be delete all file/fodders from destination Any body have idea ? Please correct me. (3 Replies)
Discussion started by: Chenchireddy
3 Replies
BATCHER(8)						      System Manager's Manual							BATCHER(8)

NAME
batcher - article batching backend for InterNetNews SYNOPSIS
batcher [ -a arts ] [ -A total_arts ] [ -b size ] [ -B total_size ] [ -i string ] [ -N num_batches ] [ -p process ] [ -r ] [ -s separator ] [ -S alt_spool ] [ -v ] host [ input ] DESCRIPTION
Batcher reads uses a list of files to prepare news batches for the specified host. It is normally invoked by a script run out of cron(8) that uses shlock(1) to lock the host name, followed by a ctlinnd(8) command to flush the batchfile. Batcher reads the named input file, or standard input if no file is given. Relative pathnames are interpreted from the <pathoutgoing in inn.conf> directory. The input is taken as a set of lines. Blank lines and lines starting with a number sign (``#'') are ignored. All other lines should consist of one or two fields separated by a single space. The first field is the name of a file holding an article; if it is not an an absolute pathname it is taken relative to the news spool directory, <patharticles in inn.conf>. The second field, if present, specifies the size of the article in bytes. OPTIONS
-S The ``-S'' flag may be used to specify an alternate spool directory to use if the article is not found; this would normally be an NFS-mounted spool directory of a master server with longer expiration times. -r By default, the program sets its standard error to <pathlog in inn.conf>/errlog. To suppress this redirection, use the ``-r'' flag. -v Upon exit, batcher reports statistics via syslog(3). If the ``-v'' flag is used, they will also be printed on the standard output. -b Batcher collects the text of the named articles into batches. To limit the size of each batch, use the ``-b'' flag. The default size is 60 kilobytes. Using ``-b0'' allows unlimited batch sizes. -a To limit the number of articles in each batch, use the ``-a'' flag. The default is no limit. A new batch will be started when either the byte count or number of articles written exceeds the specified limits. -B To limit the total number of bytes written for all batches, use the ``-B'' flag. -A To limit the total number of articles that can be batched use the ``-A'' flag. -N To limit the total number of batches that should be created use the ``-N'' flag. In all three cases, the default is zero, which is taken to mean no limit. -i string A batch starts with an identifying line to specify the unpacking method to be used on the receiving end. When the ``-i'' flag is used, the initial string, string, followed by a newline, will be output at the start of every batch. The default is to have no ini- tial string. -s Each article starts with a separator line to indicate the size of the article. To specify the separator use the ``-s'' flag. This is a sprintf(3) format string which can have a single ``%ld'' parameter which will be given the size of the article. If the separa- tor is not empty, then the string and a newline will be output before every article. The default separator is ``#! rnews %ld''. -p By default, batches are written to standard output, which is not useful when more than one output batch is created. Use the ``-p'' flag to specify the shell command that should be created (via popen(3)) whenever a new batch is started. The process is a sprintf format string which can have a single ``%s'' parameter which will be given the host name. A common value is: ( echo '#! cunbatch' ; exec compress ) | uux - -r -z %s!rnews EXIT STATUS
If the input is exhausted, batcher will exit with a zero status. If any of the limits specified with the ``-B,'' ``-A,'' or ``-N'' flags is reached, or if there is an error writing the batch, then batcher will try to spool the input, copying it to a file. If there was no input filename, the standard input will be copied to <pathoutgoing in inn.conf>/host and the program will exit. If an input filename was given, a temporary file named input.bch (if input is an absolute pathname) or <pathoutgoing in inn.conf>/input.bch (if the filename does not begin with a slash) is created. Once the input is copied, batcher will try to rename this temporary file to be the name of the input file, and then exit. Upon receipt of an interrupt or termination signal, batcher will finish sending the current article, close the batch, and then rewrite the batchfile according as described in the previous paragraph. HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. This is revision 1.5.6.1, dated 2000/08/17. SEE ALSO
ctlinnd(8), inn.conf(5), newsfeeds(5), shlock(1). BATCHER(8)
All times are GMT -4. The time now is 04:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy