When I run rsync --recursive --times --perms --links --delete --exclude-from='Documents/exclude.txt' ./ /media/myusb/
where Documents/exclude.txt is
- /Downloads/
- /Desktop/books/
the files in those directories are still copied onto my USB.
And...
I used fetchmail to download all my gmail emails. When I run rsync -ar --exclude-from='/home/xtheunknown0/Documents/exclude.txt' ./ /media/myusb/ I get the first image at url.
I am trying to use an old box as backup server. I have tried a couple of possibilities along the lines of:
Quote:
rsync -a --delete --progress --log-file=/home/$USER/info.txt -e ssh /home /etc root@192.168.0.106:/mnt/back
The problem is it does not delete files that has been removed from my local system? I run the command as root on the local system.
(I realize I should properly not ssh into the server as the server's root but I'm having trouble with the permissions and I want to make sure everything else works before messing around with it)
I am using rsync for incremental backups. I am backing up to a second hard drive on my computer. When I check the individual backup directories (backup.0 through backup.4) with du -hs they each show 12G; when I check the parent directory squeeze it shows 15G. Over 4 backups I have added 3G. I haven't made very much for changes to directories I'm backing up and am using hard links. I have included some info below.
Quote:
Backup script:
#!/bin/bash mount /mnt/backup cd /mnt/backup/squeeze/ rm -rf backup.7
Thought I'd post it here because it's more server related than desktop... I have a script that does:
[Code]....
This is used to sync my local development snapshot with the live web server. There has to be a more compact way of doing this? Can I combine some of the rsyncs? Can I make the rsync set or keep the user and group affiliations? Can I exclude .* yet include .htaccess?
I have a tiny shell script to rsync files between two servers and remove the source files.
This script works fine, when it has been initiated manually or even when the rsync command is executed on the command line.
But the same script doesn't work, when I try to automate it through crontab.
I am using 'abc' user to execute this rsync, instead of root, as root login to servers are restricted in all of our servers, by us.
As I mentioned earlier, manual execution works like charm!
When this rsync.sh is initiated through crontab, it runs the first command(chown abc.abc ...) perfectly without any issues. But the second line is not at all executed, and there is no log entry i can find at /mnt/xyz/folder/rsync.log.
CentOS 5.2 64bit 2.6.18-92.el5xen. Use rsync with --link-dest for nightly backups, works well. Was recently asked to start weekly backups to an external drive for off-site storage. The regular syncing works but hard linking seems to be ignored. So the backup is long with no space saving advantage. Here is an example of the command being run:
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'm using Ubuntu 10.04 LTS server and Postgresql 8.4. I have a .sh script that is run by cron every other hour. That works fine. The .sh script includes an rsync command that copies a postgresql dump .tar file to a remote archive location via ssh. That fails when run by cron; I think because it is (quietly) asking for the remote user's password (and not getting it). I set up the public/private ssh key arrangement. The script succeeds when run manually as the same user that the cron job uses, and does not ask for the password. I am able to ssh to the remote server from the source server (using the same username) and not get the password prompt (both directions), so why doesn't rsync work? I even put a .pgpass file in the root of that user's directory with that user's password, and the user/password are identical on both servers.
I think the problem is rsync is not able to use the ssh key correctly. I tried adding this to my script but it didn't help.
Code:
Here is the rsync command embedding in the .sh script.
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 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 want to exclude all log files from being transferred from the src to dest and delete all existing ones on the destination so im using --exclude=*.log with --delete-excluded which works great ...
but i want to keep a certain log file intact on the destination. I want a --exclude-from-delete option
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?
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 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).
Problem: rsync to NAS gives 'rsync: failed to set times on "/media/NAS": Operation not permitted (1)'
Efforts to date.
1.Initial set up was ubuntu 10.04 on stock DNS 323 NAS. Grsync would copy file names and folders to NAS but they all were 0 bytes and no data.
2.Set up FFP on NAS, installed rsync server on NAS, and retried. Grsync now copies all the files and folders,but get the 'rsync: failed to set times on "/media/NAS": Operation not permitted (1)'
3.Grsync with -t removed (does not preserve time) works without error message, but does not keep time/date on NAS backup.
I'm running rsync and outputting the log to a file using --log-file option. I am also using the --link-dest option, which in turn is adding the hard link creation output for EVERY file in the log file. I want to ONLY show the actual file transfer (if any) that take place.In the 'log format' section of rsyncd man page here I assume you can do this, I just can't make sence about the code.
I am attempting to alter the permissions of /dev/snd and its contents to rw-rw-rw at boot time via the file /etc/security/console.perms.d/99-snd.perms, which contains the following lines:
This has worked with previous Fedora installations up to Fedora 10, maybe even Fedora 11, but does not in Fedora 13. Further, the file /etc/security/console.perms.d/50-default.perms that has been present in the earlier versions of Fedora is missing; I don't even find it using 'yum whatprovides'. The Deployment Guide for Fedora 12 (there isn't one for Fedora 13 (yet?)), indicates that this is still the correct way to control console access to devices, and there are no mentions of any changes in the Fedora 13 Release Notes, but it is not working for mePS: I have verified that the permissions and selinux contexts of /etc/security/console.perms.d/99-snd.perms are correct although, in any case, it does not appear to be an selinux issue as booting with selinux disabled does not help. Searching through the various sysconfig, udev, etc.
However, can I run a command and create symbolic links for all files in a given folder and its subfolders and have all the links be in one folder?
I have a file structure such as:
FolderA FolderB FolderC
and I want to have symbolic links for all the files in the A, B, and C all in one new folder (FolderALL) for example. I have hundreds of folders that need to be done, so a simple 1 line command would be ideal if possible.
I want to use rsync in order to have a folder synced at startup with my fat32 partition. I figured out how to mount the fat32 partition automatically at startup but I'm failing with the rsync command.I came across this script but it works only the first time, when there is a new file to sync it fails.
I've bought a NAS (Western Digital My Book World Edition 1TB) which I want to use to make backups (preferably incremental) of some important files.
After much deliberation in finding suitable backup software it seems like good old rsync is the best thing for the job (backintime struggles to copy to remote locations?)
I have enabled SSH on the NAS config. I'm using the following command to do a test run on a small folder:
Code: sudo rsync -azvv -e ssh /home/matt/Careers/ admin@192.168.1.100:/public/AutoBackup/ And I get the following error: Code: admin@192.168.1.100's password:
[Code].....
Anyone know where I'm going wrong here? I'm sure it's probably something simple but I can't crack it. I've tried variations on the destination folder such as admin@192.168.1.100:/AutoBackup/ without success.
is there a recursive shell or Perl script to delete files with the same name as the parent folder? i wish to include the starting folder name as argument to the script.
I want to use rsync to synchronize some folders on my LAN. I have this working with two scripts; one runs at the beginning of my work session and gets the latest directory tree from the server, and the other runs at the end of the session to put any local changes back on the server. My "get" script looks something like this:
This works well, and with the "b" option any file that has been deleted from the master directory tree on the server will be deleted from the local machine and moved to the local backup directory. This is a safety measure to prevent the loss of files through a mistake (on my part).
I want to run both scripts from the local machine, but the "put" script will not save deleted files to a backup directory. I tried using a remote backup directory like "my_server:/home/user/rsync_backup_dir" but this did not work. Is there a way to backup files deleted from a remote server from an rsync script run locally?
I saw in a magazine reference to using rsync to have identical copies of folders. This looks like something I could find useful as I have a large number of items in need of safe backup.
I have the folders on an old system on a home network and would like to copy these over to a USB Hard Drive.
Currently the folders reside on SFTP xxx.xxx.xxx.xxx and I wish to sync them to a USB port on my laptop.
I setup keyed ssh between two of my computers on my lan. It was working great. I used Ubuntu's Passwords and Encryption Keys tool to generate the key.
Yesterday I tried rsync'ing a grip of files to the ssh server and couldn't get it to work, I figured I was just messing the rsync command up. Today I just tried to log in using ssh and it just hangs there after I type the ssh command.
With verbosity on it stops at checking the blacklist file. Does this mean it decided my key is one of the badly generated ones? Why would it decide this now I thought it was supposed to catch that when generating the key.
Also I just checked that file it's trying to check doesn't even exist. Should it?
I'm currently trying to have crontab to automatically backup files from ramdisk. It works perfectly when I run it myself by simply cd:ing to scripts directory and type ./save_world.sh.
The problem is, that crontab DOES (at least it looks like it) run that command every one minute. /var/log/syslog does show it executing that line every one minute without any errors. I'm currently very confused what I did wrong here. I have tried rebooting, fiddling with crontab line, tried sudo crontab -e but nothing seems to work.
My script is called save_world.sh and it is located in /home/phoe/minecraft/rpg/
Code:
My crontab -e has one line and it is following:
Code:
I haven't determined any specific time yet, because I'm just trying to get it work first.