Ubuntu :: Rsync Deletes Files It Should Not Delete
May 4, 2011
I built a script that downloads my podcasts using Gpodder into the directory /HOME/SHARED/PODCASTS/ (with a subdirectory for each podcast)The script then selects the latest episode and copies it over to a target directory (it empies the target directory first and copies over everything) I want to use RSYNC to make sure the 'not so fresh' episodes get deleted and the "fresh" episodes get copied over. Then dropbox can sync the "new" files over to the cloud where i can access them via my ipad/iphone (whole other story).The thing is : i've replaced the cp command with the RSYNC command and now the script is acting strangely.
It selects and sync's over the "newest" podcasts to the destination directory. Then it suddenly DELETES all the episodes in the destination directory and copies over the three last files.
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.
I've noticed since upgrading to Maverick that nautilus has become very buggy and crashes quite a bit (I've noticed it tends to happen during multiple file transfers but really it happens often and not only because of transfers).
While I've been able to tolerate this crashiness, today I came across a problem that is very distressing. If I have two files in a folder and I rename one so that it has the same filename as the other, nautilus does not display an error message. Instead what seems to happen is that it retains one file and deletes the other permanently (There seems to be nothing in the trash as far as I can tell).
Has anyone come across this error before? If you have, I'd really appreciate any advice on how to fix it.
I have some developers with Desktop User accounts. How can I allow them to delete files owned by www-data which are created under their accounts (/home/username/public_html) by PHP scripts they are coding and testing.I tried to edit www-data user group and add the user as a member of it but this has no effect - the user still unable to delete these files only by creating another PHP script!
Slackware 12.2 has the unkind habit of deleting all the /dev/fd?u* floppy special files upon boot-up. I have to make another directory (I use /floppy) to contain these files so I don't have to keep copying them from an earlier distribution (12.1) Now, for example, to format a 1743 kilobyte floppy, I do fdformat /floppy/fd0u1743 mformat a:If I copy these special files to /dev (where they belong) then some part of Slackware Linux 12.2 deletes the special files when I power down and power up the machine.Slackware 12.1 and earlier leave floppy special files severely alone upon shutdown/startup.I cannot seem to "grep" a reference to /dev/fd anywhere in /etc/rc.d or its subdirectories. Why is Slackware 12.2 deleting them?
the script should take as input in the begginig the username of the user and then deletes all the files and folders from the user in every place he has them. script must also check if the parameters have been given correctly (only one and that one must be a username) Doesnt all the files of a user exist on a folder with his name? what if i delete this folder? Will something like this work?
E_NOARGS=65 if [ -z "$1" ] # Exit if no argument given. then echo "Usage: `basename $0` directory-to-copy-to"
I want to synchronize sets of files (e.g. from or to flash memory). rsync is powerful, but --delete option is dangerous. Anyone know whether there's a way to do --delete interactively, i.e. get rsync or some near equivalent to ask (y/n, in a console window) before deleting?
I would like to use rsync to keep the hard drive in my media server synced with my video collection on my linux server. The media server I believe is running some version of linux running samba. I mount the media servers share to a folder on my linux server & use the following command: rsync -a -vv --delete /home/shared/Videos/* /mnt/WDLive/Shearer Files/Movies/
However, it does not delete files on the media server that I delete on the source. I also created a new folder on the source & moved some of the files into it. When I ran rsync again, it created the new folder on the media server, but it recopied all the files from the source again, instead of moving the files which were already on the media server into the new folder, so no I have 2 copies.
wrote a script to sync my netbook music with my server music and everything was fine.but if for some reason lets say i run it accidently and i'm not connected to my network, i just wiped my netbook music .here's what i got so far:
i need to have the --delete option in rsync (say i sync it and realize i hate some music, when i delete it from the server i don't want it still on the netbook.i want an if statement in here somehow, but i'm not sure how to do it.something like, the first command in the script should be a ping test, if ping doesn't work end the script, if ping does work continue or if the server music gets mounted to the created directory continue, if the mount failed, or even in the mounted folder is empty stop the script
what can i do here to ensure i can keep the --delete and not have to worry about losing my music if the mount fails?
I installed cygwin with rsync on a Win XP Machine. My goal is to backup a folder from one hard drive to another (both on XP machine).
I run the following command from a batch file:
Works fine except the --delete flag is not working. Copies everything in source to destination, but doesn't delete some extra files that are present on the destination, but aren't on the source, which it's supposed to. I looked at the rsync man page, and I'm doing everything right... such as not using wildcard.
The same command works perfect on another computer (XP machine; source and dest both on XP machine).
I just can't stand knowing that there's a slight problem with my PC.I have roughly 12.5 Gigs of files, mostly movies that are multiple clones of a particular movie (which was an entirely different problem altogether) and I CANNOT DELETE THESE THINGS! There has to be a simple way to do it from terminal, problem is, I can't seem to find the trash directory in terminal.
the permissions for my home directory were accidentally changed from 'access files' to 'create and delete files', and I changed them back, but ever since then I am not able to change any preferences/settings at all. power management, themes, panels, emerald, anything. my user account is supposed to be the administrator, and all the user privliges are checked. how to get control of my computer back?
So I just used rsync to backup about 400gb of data to my NAS. Look just over a day to complete, which is what I figured. I decided I should run rsync again to see how its going to handle comparing and only adding new files to the remote location. So I added a few new files and then ran the backup again. Well rsync is trying to do a complete copy of all of my original data, even though they have not changed.
Is there a way that I can tell rsync to compare the two directories and only add the new files and delete the ones that are no longer in the original location?
I am running Ubuntu 10.04. I am transferring roughly 62 GB of data libraries to my 84 GB /home partition. I'm using rsync because scp kept stalling, and I had to restart it over and over. Things were going great until recently when it began to show an error: "failed: No space left on device (28)" These are the things I've done so far: Used the GUI to find out how much I have copied so far: 5,149,552 which take up 30.2 GB. df -h, it tells me that my /home partition is 56% used, and that I have 33 GB available. (42 GB used out of 78 GB with 33 GB available) Also, none of my other partitions are anywhere near 100%. the /home partition is the most-used and it's only a little over half-full. du -s in the directory where I'm copying all of this: it also returned 42206500. Additionally, when I try to save screen captures, it sometimes fails with a "device full" error. What's going on? Am I really out of space? Why doesn't it show me that I'm out of space?
Is there a hidden temp file that rsync uses that just got too full? I did a little research on wikipedia and it said that ext4 has a 64,000 directory limit. Could it be that I somehow broke that limit with all of these files? Solution: not enough inodes for the vast amount of subdirectories on hard drive. This wasn't an RSYNC problem, rather, a partition configuration issue. To check inode usage: df -i If you want to add any inodes, you will need to backup your partition and format it using mke2fs (man mke2fs). Be sure to change the respective inode setting.
I have Ubuntu on both my laptop and desktop machines, both are connected to the same network. I back up the laptop to the desktop by running the following on the laptop:
rsync -avv --stats /home/alisdt email@example.com:/home/alisdt/laptop_backup (with the IP address of the desktop instead of the many x, obviously). Whenever rsync hits a large file (greater than a few MB), the network use rapidly drops to ~60KB/s (that's kilobytes not bits). When I copy the same file to the same place using scp, I get > 500KB/s throughout the transfer. Things I've tried:
* mounting the desktop home dir on the laptop using SSHFS -- a simple file copy is fast, rsync is still slow * ditto with NFS * rsync --whole-file option, in case the delta-transfer algorithm was choking on large files * rsync --inplace option * HPN-SSH (http://www.psc.edu/networking/projects/hpn-ssh/) to enable dynamic window and unencrypted bulk transfer, just in case it was some ssh bottleneck I think it's either an rsync application problem, or a network problem that is only affecting rsync. Any ideas, or other ideas of what I can try to debug? In case it's relevant, I'm using 9.04 on both machines. (A standing bug prevents me from upgrading the laptop, and I haven't bothered to upgrade the desktop).
well, i know ther are issues when using rsync to copy files to ntfs partition like file permission blah blah. the thing is, i need to backup my music files periodically onto a ntfs partition from ext4. i really dont care about file permissions or any other stuff. when i use rsync, it should update the mp3 files on my ntfs (external) disc with the new ones.can i give a go with this operation? i have lot more important files on the external disc and i dont want this rsync corrupt or delete those files coz they are highly important files.
My Source folder contains 424.8 GB in 502,474 files. My Destination folder was created fresh, and after the copy contains 394.0 GB in 486.514 files. I am running it as grsync with root authority. The only options are to preserve time, permissions, owner and group., and to produce a verose output and transfer progress. There are no exceptions specified to skip any files.
I have two directories, dirA whicht contains N gb of data and dirB which is supposed to contain only the newest M gb of data from dirA. When files are added to dirA, they sould also be added to dirB, while the oldest files in dirB should be deleted.Is that possible with rsync? or any other software?