Tag Info

Hot answers tagged

12

For repeatability I suggest to put the lines into a small script, but without the keyword sudo: #!/bin/bash rsync -v -v -r -h -t --progress /Volumes/My\ Book/Backups.backupdb/MbpScs-van-iSCS/2014-01-02-233653/SSDaeffer /Volumes/BackupMyBook/ViaMacbookMove/DitIsDeMap rsync -v -v -r -h -t --progress /Volumes/My\ ...


8

Note the usage for rsync is rsync [OPTION]... SRC [SRC]... DEST which means this can be more simply written as rsync -r -t -h /src1dir /src2 /src3 /destdir which isn't subject to sudo session timeouts. You didn't ask, but the option -a is far more comprehensive than -r -t.


4

The short answer is yes, you can use lftp. But since it looks like you are backing up a running system, which will include changed (log-)files, you are IMHO better of sticking with rsync, which handles changed files by sending (compressed) deltas, not by uploading complete new files. You can use a script that repeatedly runs rsync. The first rsync will ...


3

There are many ways of doing this. The approach you tried would have worked perfectly if each sudo did not require you to enter a password. Since it does, the commands would hang since the 2nd would ask for a password and you weren't there to give it. Therefore, you need a way of running everything with a single sudo call. Here are a few ways of doing this. ...


2

There are very few files that absolutely must be different between two machines, and need to be regenerated when cloning: The host name /etc/hostname. The SSH host keys: /etc/ssh_host_*_key* or /etc/ssh/ssh_host_*_key* or similar location. The random seed: /var/lib/urandom/random-seed or /var/lib/random-seed or similar location. Anything else could be ...


2

/var/cache is not a free-for-all like /var/tmp. Each service that requires it has a subdirectory in /var/cache with appropriate permissions for it to store files. On Debian and derived distributions, you can run dpkg -S /var/cache to find what packages have set up directories under /var/cache, and apt-get --reinstall install PACKAGE_NAME … to reinstall ...


2

Rsync is very often used to copy files over a network link. It's also used to copy files to backup media. Removing source files is a fairly rare usage of rsync. Preserving metadata is commonly requested but optional. So it takes a combination of unusual use cases for rsync to have the opportunity to move a file from the source to the destination, rather than ...


2

I don't think that rsync can do that, but you can make a list of files, modify that list and copy it as a script to the destination. Assuming that your file names don't contain newlines or single quotes ('), run this on the source machine: cd basedir find . -type f | sed 's/^/rm -f '\''/' | sed 's/$/'\''/' > /var/tmp/to_remove then copy over the ...


2

You could use prename to get what you want. On some distributions (eg Debian/Ubuntu) this should be installed as default and aliased to rename. Other distros may use a different rename. You could change to the directory above the source directory and do: find source -exec prename 's:^source:/path/to/dest:' {} + This will refuse to move files that already ...


1

Whatever you want, I can't think of a way to do this with rsync alone. If you truly want to entirely skip directories that exist on the destination side, then the test isn't recursive, only the toplevel directory or directories matter. For each argument to copy (dirN in rsync --flag-that-you-hope-exists dir1 dir2 dir3 destination/), either the directory ...


1

It's in the link you provided: rsync the package repository contents and/or updates The whole repository can be updated (or even fetched right away, skipping the downloadable tarballs part) from the origin servers, but note that your repository would then include revisions for many releases of OpenIndiana (147-151a4 as of now) and take over 8GB of disk in ...


1

If you restore on top of a fresh installation, you need to be careful to delete files that aren't being restored. Using rsync --delete during restoration will take care of that. However, if you're going to use a live CD to restore, it may be easier to do the following: Back up a complete image of your boot partition (cat /dev/sda1 >boot.image). ...


1

Warning: This answer will not work on file systems that do not support hard links (e.g., FAT). Another option (which may be more portable) is cd source_directory find . -type f -print0 | cpio --pass-through --null --link --make-directories dest_dir cpio (copy in&out) is a dinosaur that predates tar.  Like tar, it can create or extract from archives. ...


1

If you're not going to use the remote file system as the data source of what has been transferred then you need to externally track the files that have been successfully transferred previously, then exclude them from future transfers. rsync can include and exclude files based on patterns in a file so you can include a specific list of files in a transfer. ...


1

If you know you're going to want to do this in advance ... Create a script session on your home computer (using -f to flush buffer): script -f output.txt rsync -vr /media/master /media/slave (Ctrl+D to finish the script session when get home) At work you can track output.txt: tail -f output.txt


1

I had a similar task, in my case I could not use rsync, csync, or FUSE because my storage has only SFTP. rsync could not change the date and time for the file, some other utilities (like csync) showed me other errors: "Unable to create temporary file Clock skew detected". If you have access to the storage-server - just install openssh-server or launch rsync ...



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