General :: Rsync Deleting Files From Destination Directory?

Jul 14, 2011

We have an rsync cron job set up to mirror all the files in a "..dashtdocsdocs" folder to the same folder on another server. It copies all the files over correctly and deletes any files in the "docs" directory that aren't in the sending directory, but it also deletes any files we put in the target directory's parent folder (..dashtdocs or other subfolders like ..dashtdocsimages) even though they've been excluded in the .rsync-filter file.

Here's our current rsync .sh:

/usr/local/bin/rsync --stats -qPzrtpl --delete --password-file=/var/run/.appprodrsync --log-file=/export/home
/webuser/logs/rsync-extranet-log -FF /export/home/ appprodrsync@appprod::dprweb_extranet/ > /export/home/webuser/logs/rsync-extranet-output 2>&1

[code]....

So for example server A has ..dashtdocsdocs and ..dashtdocsimages. Server B has ..dashtdocsdocs but if I manually copy the images folder over to ..dashtdocsimages, the images folder gets deleted from the target directory every time rsync runs.

A: ..dashtdocsdocs
..dashtdocsimages
B: ..dashtdocsdocs
..dashtdocsimages (<-- gets deleted everytime rsync runs)

I'd like to keep just the docs directory synched and update other folders manually, but they keep getting deleted. It looks to me like it's running a delete-excluded option, but that option wasn't used.

View 2 Replies


ADVERTISEMENT

General :: RSYNC - Ignore A Directory On Destination Box?

Jul 28, 2011

I am performing a dry run using Rsync on 2 different boxes.While i'm doing that, Under destination directory, I want a specific directory x to be ignored for sync.Please let me know the exact pattern to ignore the directory.The current command I'm using is:rsync -avnc --delete $LOCAL_DIR $USERNAME@$DESTINATION_IP:$REMOTE_DIRunder DESTINATION_IP, I would want to ignore a particular directory under REMOTE_DIR.

View 1 Replies View Related

General :: Files Seem To Take Up More Space In Destination After Rsync Copy?

Feb 9, 2010

I have recently purchased an external hard drive in order to backup my home partition. In my PC I have a "1.5T" drive with several partitions on it, containing OSes and the home partition. The home partition is 1.3T according to df, the external drive contains one partition that spans the entire disk,df reports it as 1.4T in size. Both partitions are ext3. When I use rsync to copy files from the home partition to the external partition, the external disk becomes full, despite the destination - supposedly - being larger than the source. I don't understand why copying files from one partition to a slightly bigger partition should need more space than on the source partition. Does anyone know what is happening ?

Details : I created the partition on the external drive with gparted; gparted reported it the already have several gigabytes in used space immediately after the partitions creation - I thought at the time that this must be normal. The home partition contains many files of all sorts, including lots of big audio and video files. If you are wondering, for all my important files this external disk is only secondary backup, as they are also backed up to the "internet".

These are the mount points :

/mnt/tmp/ : home partition, /dev/sdb6
/mnt/external/ : external partition, /dev/sdc1

I used rsync to copy the files, I know there are more efficient ways to do this, but I wanted to use the same command that I will subsequently run to sync the backup.

rsync -av --progress --stats --recursive --perms --links --delete /mnt/tmp/ /mnt/external/

Next I tried adding the --sparse switch, as I was wondering if the problem may come form sparse files. I don't know however if rsync would go back and shrink the sparse file by just adding the switch and executing the command. I also added --one-file-system, for good measure. Here is what I ran next :

rsync -av --progress --stats --sparse --one-file-system --recursive --perms --links --delete /mnt/tmp/ /mnt/external/

I tried an fsck on the home partition :

fsck -f /dev/sdb6

This is the output from the last rsync :

rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Broken pipe (32)
rsync: write failed on "abcd.avi": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(302) [receiver=3.0.6]

[code]....

Looking at the destination after a partial copy seems to indicate that the problem is not symbolic links being "expanded". I have not checked the source filesystem for sparse files, nor the destination to see if these files could be larger there, as this does not seem trivial.

Here is some additional info :

$ df /mnt/tmp/
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sdb6 1415342836 1414173740 369096 100% /mnt/tmp

[code]....

View 2 Replies View Related

General :: Rsync Not Deleting Files On Target

Sep 8, 2010

I'm using the command below to sync two directories. Problem is insted of deleting the files on the target directory it simply appends a ~ character at the end of the file name. Not sure why this is happening?I'd like to have all deletes on the source replicated on target.

View 2 Replies View Related

Fedora :: Use Rsync To Backup My Music Collection - Add Files To The Destination Drive?

Mar 6, 2010

I'm currently learning to use rsync to backup my music collection. I have a Firefox tab open to the rsync manual page(s) and have been reading man rsync and running experimental rsync operations.I've been doing this for the last 3-4 hours. I've used rsync for this purpose in the past with disastrous results. What was and is once again (due to a month and a half of file pruning) a 9000 file music collection had mysteriously grown to over 25,000 music files and 80GB of data! This was likely due to the fact that I didn't really know what I was doing with rsync and had never spent too much time learning about all the parameters, what their functions are and how they may relate to my goal.Here are the particulars:

* Source drive is a 500GB disk, /media/sata500/music/.

* Destination drive is a 250GB USB disk, /media/FreeAgent/music, connected to the same computer that houses the 500GB disk.

* I want to copy or backup files from /media/sata500/music to /media/FreeAgent/music.

* I do not want to create ANY duplicates of files that exist.

* I only want to add files to the destination drive if they are new on the source drive, like if I rip a CD and add the contents to the source. I want them copied over next time I run rsync.

Here's the rsync command in it's most recently used form, and probably very immature at this point.

Code:

rsync -t -r -vv --stats -i --log-file=/home/glenn/rsync.log /media/sata500/music/* /media/FreeAgent/music/

This appears to have copied all files and folders and I'm satisfied that my goal has been met with some success. To convince myself of this I ran the command and then once it was complete I added 2 new songs putting them in their respective folders on the source drive and ran the same command again. The resulting output was

[code]....

Two files transferred. Exactly what I want.Both folders now house 20,931 files and use 40.6GB. Identical as far as I can tell.What I'm concerned about are time stamps and play count data, etc. Anything that changes the original file. I don't want this data to cause a file to be transferred as I'm afraid that the new file will be created along side the old file of the same name thereby starting this whole music collection expansion thing all over again. I've invested a lot of time and effort to get it pruned down to where there are virtually no duplicates and albums are correct in that they contain the proper songs in the proper order.

View 14 Replies View Related

General :: Deleting All Files From Directory Except For Two

Nov 25, 2010

I'm writing a Perl script which performs linux commands.I have a directory with a load of files.

Code:exec_cmd('rm $(ls * | grep -v file1)');
This command will delete all except for file1. How can I modify this to delete all files except for file1 & file2?

View 2 Replies View Related

General :: How To Delete All Files In Directory Without Deleting?

Feb 9, 2010

I know that rm -i will prompt wether you want to delete each file.But rm -i -r will prompt for each file in each subdirectory recursively. How to make it prompt just for the directory itself, and then delete its contents without asking?How to delete all the files in a directory without deleting . and ..?How to recursively delete all tilde files in a directory?How to GUI file managers delete files to Trash? Where is this "Trash" located? Can you delete to trash in the command line?

View 14 Replies View Related

OpenSUSE :: Way To Get Rsync To Delete Files If They Were Deleting At Source?

Jun 11, 2011

I have 2 folders that are synced using rsync. Right now if I delete a file in the source folder, the destination folder still retains that file. Is there a way to get rsync to delete files if they were deleting at the source?I could not find anything in the man page.not sure if I'm missing something or if that feature just doesn't exist.

View 4 Replies View Related

General :: Del Command To Remove Files To Directory Instead Of Completely Deleting Them?

Dec 2, 2010

how to write a script so that when I use the 'del' command it removes/sends the files / folders to a I specify for example 'dustbin'

View 1 Replies View Related

General :: Rsync N Newest Files In A Directory?

Nov 8, 2010

What would be the easiest way to go about rsyncing the n newest files in a directory to a remote server?

View 2 Replies View Related

General :: Order Of Transfer All Files Under A Directory By Rsync

Sep 25, 2010

If transfer all files under a directory by rsync, what is the order that rsync determines to transfer the files one by one?At first it looked like rsync transfers files in alphabetical order, but later I found rsync skipped some files in the first sweep through the alphabetic order, and then went back to transfer files that were skipped in the first time and this time still in alphabetic order.

View 1 Replies View Related

General :: Rsync Speed For Single Files And Directory?

Mar 23, 2010

Recently i am trying to check on the rsync speed for single file(2.4GB iso) directory ( 900MB directory with files inside ) When i run the rsync for single file: the speed i get is average 50MBps However, for a directory: average speed is 10MBps Is there any reason behind this ? i tried to google but unable to get the concept.

View 2 Replies View Related

Programming :: Deleted Files In Directory With So Many Files Without Deleting Directory Itself

Nov 14, 2010

There are millions of files in many directories. Wherenver i try rm * or find or use xargs, they say 'argument list too long' and exit. How can i deleted files in a directory with so many files without deleting the directory itself.

View 3 Replies View Related

General :: Rsync Files Recursively But Place In One Remote Directory?

Jan 29, 2011

i would like to find and backup all *.mp4 files from /Pictures and its sub-directories and move them to a single directory on a remote. I can find and move the files but I don't want the directory structure...just the files to be placed in the remote directory.

To find my files I use

rsync -r -a -v -e "ssh -l user" --delete --include '*/' --include '*.mp4' --exclude '*' /home/drew/Pictures/ remoteserver:/Users/drew/mp4

but this creates all the subdirectories

I also tried

find ~/Pictures -name "*.mp4" -exec rsync -r -a -v -e "ssh -l user" --delete {} remote:/Users/drew/mp4 ;

This works but takes forever

View 3 Replies View Related

General :: Gunzip To A Different Destination Directory?

May 9, 2010

how do I gunzip to a destination directory other than the current one?

this did not work:

gunzip *.gz /putthemhere/

View 2 Replies View Related

General :: Specifying Destination Directory When Installing Slackware ?

Jan 25, 2010

I'm trying to install Slackware package into some specific locations, like for example, I want to put Linux base package into at / and put applications on /usr/local. However when I'm installing using "setup" program, I cannot find a part that let me to choose the installation destination.

At "setup install" option, it gives six different installation method like full, newbie, menu, expert, custom, and tag path. But none of them (I cannot find it) gives an option where to put the installation package to.

View 2 Replies View Related

Server :: RSync Without Delete Any File On The Destination?

Feb 16, 2010

I'm using rsync for a backup-sript at the moment and want to keep all files. The files are always unique, so I want to rsync without delete any file on the destination.

I've tried with --no-delete and --max-delete=0 but nothing seens to work. Is there even a possibility to do so?

View 2 Replies View Related

Ubuntu :: Use Rsync To Copy ONLY Home Directory And No Files?

Jun 1, 2011

How can I use rsync to copy ONLY the my home folder (and nothing inside of it, just the folder name) to another machine. I've tried things like

Code:

rsync -av /path/to/src /path/to/dest/

or

Code:

rsync -av -f"+ */" -f"- *" /path/to/src /path/to/dest/

This last option recursively (through the -a switch) copies only folders, including all subfolders. If I try

Code:

rsync -v -f"+ */" -f"- *" /path/to/src /path/to/dest/

nothing is copied (not even my home folder.

View 9 Replies View Related

Slackware :: Rsync Exclude Directory With All Subdirectories And Files

Dec 26, 2010

In reading the rsync man page and browsing a lot of websites, I ended up a bit confused, or maybe it was just too much eggnog. Anyway, to exclude a directory "videos" with everything in it, which is /home/user1/camera/videos and I'm rsyncing the whole user1 directory to an external drive

[code]...

View 1 Replies View Related

General :: Copy File Recursively Ignoring Destination Directory Structure?

Jul 8, 2011

I have the following content on the source directory:

source/foo.txt
source/bar/another_file.txt
source/bar2/and_another.txt

I want copy those files to a destination directory which, after copy, shall look like this:

destination/foo.txt
destination/another_file.txt
destination/and_another.txt

How can I do this? It seems that "cp" lacks such an option

View 1 Replies View Related

General :: Change /temp Directory From Its Original /dev/hda8 To Destination /dev/hdd5?

Dec 7, 2009

On Debian Standard System I would like to is change /tmp directory from it's original /dev/hda8 to destination /dev/hdd5

Code:

Disk /dev/hda: 6448 MB, 6448619520 bytes
255 heads, 63 sectors/track, 784 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

[code]...

If I change /dev/hda8 to /dev/hdd5 and reboot the startx command fails to run.

View 7 Replies View Related

General :: Preventing Deleting Of Directory?

Jun 14, 2011

i need to restrict access of deleting to directory and partitions os disk? how do i do it?

View 5 Replies View Related

General :: Automatically Deleting The Directory In RedHat 5?

Feb 21, 2010

Something strange is happening with RedHat Linux 5. I created one directory system_verilog twice and both the times somehow it's get deleted after next booting of machine (after modification of some of the file in this directory).

View 3 Replies View Related

General :: Copying Files From Multiple Locations To One Destination

Feb 21, 2011

Suppose I have a tree structure like this:
/home/mahmood/sim/a/b/file1.cpp
/home/mahmood/sim/a/b/file2.h
/home/mahmood/sim/a/c/file3.txt
/home/mahmood/sim/d/file4.txt

How can I copy all of them to /home/mahmood/sim. So that when I run "ls" in /home/mahmood/sim, I see all files:
file1.cpp
file2.h
file3.txt
file4.txt

Can 'cp' search for all file and copy them in another folder?

View 3 Replies View Related

General :: Deleting A Directory In Emacs' Dired Mode

Feb 16, 2011

I would like to delete a directory in emacs' dired-mode.

I mark the directory with the "d" key, and then hit "x" to deleted flagged.

I then get the following error:

Is there any way to get emacs to delete the directory and stop its whining?

View 1 Replies View Related

General :: Renaming Files With Sed - Mv: Missing Destination File Operand After `$i'

Mar 20, 2011

Today i am trying to learn how to use sed. I set up a testing folder with the following files:

AAb.lol
AAc.lol
AAx.lol
test.sh

My goal is to create a script (test.sh) which renames all the files to their original name without AA. I want to end up with this:

b.lol
c.lol
x.lol
test.sh

sed seemed to be the perfect tool so i went ahead and created a script which i think should clear the job.

[Code].........

mv: missing destination file operand after `$i' From that 2nd line i can tell that $NewName is just empty. I also read something about sed needing the -e option for scripting purposes but i just don't understand it.

View 7 Replies View Related

Software :: Run Rsync To Download Files From A Server Without Rsync Daemon?

Sep 18, 2009

I just tried to sync files from one server to another. After the sync process, I found the files are bigger than original ones.

I looked up the web and found someone mentions the rsync daemon. So I have to run the daemon on one server before I run the rsync?

The command I used is rsync --partial --progress -r source destination

View 1 Replies View Related

General :: Rsync To Copy Directory Tree From NAS Drive ?

Apr 10, 2010

I have a WD world book edition 1TB NAS drive, and just purchased an acomdata 1tb drive and connected it to the NAS via USB. If I recall I think the WD NAS has a ext_ or some type of linux filesystem on it, and the acomdata has a ntfs filesystem on it.

What I want to do is copy over certain directory trees of the NAS to the USB attached drive. I usually use MS synctoy to sync folders from my windows pc to the NAS drive, and MS richcopy to make the initial transfer from PC to NAS. For this operation though, since it is taking place entirely on the NAS and its connected drive, I thought that rsync would be the best option, and it is available on my NAS drive.

Last night I entered in rsync -avr /movies/* /usb1-1share1/ to copy the entire "movies" dir to the drive, which shows up as usb1-1share1 on the NAS drive. It copied most of the directory tree ok, but a lot of the folders were empty, so this morning I tried rsync -Carv --ignore-existing /movies/* /usb1-1share1/ to try and get all the files missed, without recopying the 24GB that did make it across. This also managed to copy a few more GB over, but not everything.

I am running the command from an ssh session on the NAS using putty on my PC, in as user "admin" which should have all rights over these folders. There is a bunch of errors in the command window like this: rsync: failed to set times on "/shares/usb1-1share1/movies/classics/fulldvd/First Blood DVD/.VTS_01_2.VOB.RxdjWZ": Operation not permitted (1)

I want to restart another session and get the files it missed, but I want to find out what I am doing wrong first. Should I be doing this as root user? am I missing some switches or just plain doing it all wrong?

View 3 Replies View Related

General :: Make Rsync Ignore Directory Structure?

Apr 19, 2011

Is there a way to force rsync to not make directories in its destination directory; ie, to simply dump all of the files from the source directory directly into the destination without copying any of the folders that the files were originally in? I tried --no-dirs, but that seems to only be for empty directories.

View 1 Replies View Related

Server :: Rsync Can Not Rsync Files With Include Filter

Jul 21, 2010

use rsync to cp such files and dirs under /var/www/html/mydir directory but these two files(/dir4/1.html /dir4/2.html) cant rsync to dest mechine.

rsync configure file,below...

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved