Copying only wmv and mpg files recursively from to
From opposite host To copy remote to local rsync -aE -e "ssh -pPortnumber" user@hostA:directory target_dir
This allows you to skip the banner (usually /etc/issue.net) on ssh connections. Useful to avoid banners outputted to your mail by rsync cronjobs.
if you need to install cron jobs in a given time range. Show Sample Output
Copy file theo phần mở rộng c? đệ quy v? giữ nguy?n cấu tr?c thư mục Replace "jar" by extension which you need.
Clone a root partition. The reason for double-mounting the root device is to avoid any filesystem overlay issues. This is particularly important for /dev. Also, note the importance of the trailing slashes on the paths when using rsync (search the man page for "slash" for more details). rsync and bash add several subtle nuances to path handling; using trailing slashes will effectively mean "clone this directory", even when run multiple times. For example: run once to get an initial copy, and then run again in single user mode just before rebooting into the new disk. Using file globs (which miss dot-files) or leaving off the trailing slash with rsync (which will create /mnt/target/root) are traps that are easy to fall into.
Need to find a Mageia Linux mirror server providing Mageia 4 via rsync? Modify the "url=" string for the version you want. This shows i586 which is the 32bit version. If you want the 64bit version it is: url=http://mirrors.mageia.org/api/mageia.4.x86_64.list; wget -q ${url} -O - | grep rsync: Show Sample Output
Copies a directory structure from /home/ to /backups/home (notice that the destination does not have a trailing slash)
Useful for transferring large file over a network during operational hours
After you run this script, you can check status for broken symlink with this command: find -L . -type l
That is, after running `vagrant ssh-config` to determine ports and ip's:
vagrant ssh-config
Host default
HostName 127.0.0.1
User vagrant
Port 2200
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile /Users/romanvg/tmp/.vagrant/machines/default/virtualbox/private_key
IdentitiesOnly yes
LogLevel FATAL
Copy data to the destination using commands such as cpio (recommended), tar, rsync, ufsdump, or ufsrestore. Example: Let the source directory be /source, and let the destination directory be /destination. # cd /source # cd .. # find ./source -depth -print | cpio -cvo> /destination/source_data.cpio # cd /destination # cpio -icvmdI ./source_data.cpio # rm -rf ./source_data.cpio
This will email user@example.com a message with the body: "rsync done" when there are no processes of rsync running. This can be changed for other uses by changing $(pgrep rsync) to something else, and echo "rsync done" | mailx user@example.com to another command.
Check the ssh_config file and set the variable: StrictHostKeyChecking no
traverses e.g. "/data/myhost1.com/myrsyncshare"; logs stderr and stdout. useful with cron.
Applying filter rules is what makes this a really useful command. It's usually a pain to figure out how to sync ONLY files matching a particular pattern, and often one reverts to goofy stuff like find .. -exec rsync .. The filter hides all folders from the transfer, so that only the matching folders that store the filename are left for the sync.
update the output of rsync after completing a file but don't create newlines, just overwrite the last line, this looks a lot better in scripts where you do want to see a progress-indicator, but not the lengthy logs this option is available since rsync 3.1.0 Show Sample Output
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: