Tag Info

Hot answers tagged

4

You can use public key authentication: on the server, add a line with the command run by rsync (for security) and your public key to ~root/.ssh/authorized_keys. See the sshd(8) man page for information on the authorized_keys file format.


3

The --exclude={x,y,z} construct only works in bash and needs to be on one line without spaces, only then can bash expand this correctly. I'd suggest putting the list in a separate file and using --exclude-from=file, or doing as megahallon suggests and repeat the --exclude= option part yourself. Note also that you usually do NOT want /* as your source; let ...


3

Use relative symlinks instead: media └disk1 ├folder1 │ └folder2 (symlink to ../folder2) └folder2 When copied it will be the same, and since that is relative to the location, it will serve the same purpose in disk2. In case that's not clear, the idea is: cd /media/disk1/folder1 rm folder2 ln -s ../folder2 folder2 This last command is different ...


2

rsync With rsync it should be fairly easy to do, though not complete. Assuming ./new_Main_Directory exists, otherwise mkdir ./new_Main_Directory rsync -a --include '*/' --include '*.mcp' --exclude '*' Main_Directory/ new_Main_Directory/ This would copy only the *.mcp files and the directory structure they lie in. You can always test rsync commands with ...


2

So, the --exclude-from file, will be: var/tmp/ var/cache/ and use rsync like this: rsync -aAv --delete --stats --exclude-from /excludes /home /var /usr/local /etc /Backup/


1

I would try explicitly including the pattern of files with colons in their names like this: $ rsync -avz --include '*:*' /work /media/extern_drive --max-size '4G' Examples $ mkdir 1 2 $ touch 1/file{1..5} $ touch 1/file:{1..5} Explicitly excluding them $ rsync -avz --exclude '*:*' 1/ 2/ sending incremental file list ./ file1 file2 file3 file4 file5 ...


1

try --remove-source-files instead of --delete-after. have a look at serverfault.com/questions/363922/how-to-move-files-with-scp


1

For future reference - you can use install to do this directly: install -D ./2013/01/10/IMG_0141.JPG ../Archiv/Bilder/2013/01/10/IMG_0141.JPG Note: you need to append the file path in the second argument for this to work. In other words: Incorrect: find . -ctime +365 -exec install -D '{}' ../Archiv/Bilder/ \; Correct: find . -ctime +365 -exec install ...


1

Your find command runs into the problem that the intermediate directories (in this case /home/Bruno/Archiv/Bilder/2013/01/23/) has not been created yet. That has nothing to do with the (harmless) '.' in your path. You either have to first create the whole directory structure to the target or make a small script that you call instead of mv that first creates ...


1

I'm not sure if you can have a file list in exclude option but you can try this: $ rsync -avz --exclude delete_file_1.php --exclude dir_1/file4.txt \ directory_source/ directory_destination/ or you can: $ rsync -avz --exclude 'dir_1/dir_2/file_3.php' source/ destination/ or you can: $ rsync -avz --exclude 'dir*' <-- wildcard match here If I ...


1

Include / (the root filesystem), and include the root of any other filesystem you want to back up (for example, if /home is on a separate partition, include it as well). Use the -x option to exclude all other filesystems: in-memory filesystems like /proc and /sys, mounted removable media, remote filesystems, etc. Exclude the files you don't want to back up. ...


1

You can take full system backup using rsync. You can use --exlude=PATTERN for all directories that do not required . rsync -- a fast, versatile, remote (and local) file-copying tool -a, --archive archive mode; equals -rlptgoD (no -H,-A,-X) -A, --acls preserve ACLs (implies -p) -X, --xattrs preserve ...


1

From the rsync man page Note also that the --filter, --include, and --exclude options take one rule/pattern each. To add multiple ones, you can repeat the options on the command-line, use the merge-file syntax of the --filter option, or the --include-from/--exclude-from options. So in your case you should you probably just want to ...


1

rsync has a -u option that does: "This forces rsync to skip any files which exist on the destination and have a modified time that is newer than the source file. (If an existing destination file has a modification time equal to the source file’s, it will be updated if the sizes are different.)" So a shell script that contains 1) the command you gave ...


1

To see total progress with rsync, the modern versions (from 3.1.0) has option --info=progress2. rsync must be running on the same machine as source files (or with NFS) for this to show sane values. Don't forget to supply -a option too if you copy system directories.



Only top voted, non community-wiki answers of a minimum length are eligible