Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Rsync
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Examples == A command line to mirror [[FreeBSD]] might look like:<ref>{{Cite web |title=How to Mirror FreeBSD (With rsync) |url=http://www.freebsd.org/doc/en/articles/hubs/mirror-howto.html |access-date=18 August 2014 |publisher=Freebsd.org}}</ref> <syntaxhighlight lang="bash"> $ rsync -avz --delete ftp4.de.FreeBSD.org::FreeBSD/ /pub/FreeBSD/ </syntaxhighlight> The [[Apache HTTP Server]] supports rsync only for updating mirrors.<ref>{{Cite web |title=How to become a mirror for the Apache Software Foundation |url=http://www.apache.org/info/how-to-mirror.html |url-status=live |archive-url=https://web.archive.org/web/20140821040343/http://www.apache.org/info/how-to-mirror.html |archive-date=21 August 2014 |access-date=18 August 2014 |publisher=Apache.org}}</ref> <syntaxhighlight lang="bash"> $ rsync -avz --delete --safe-links rsync.apache.org::apache-dist /path/to/mirror </syntaxhighlight> The preferred (and simplest) way to mirror a [[PuTTY]] website to the current directory is to use rsync.<ref>{{Cite web |date=20 December 2007 |title=PuTTY Web Site Mirrors: Mirroring guidelines |url=http://www.chiark.greenend.org.uk/~sgtatham/putty/mirrors.html#guidelines |url-status=live |archive-url=https://web.archive.org/web/20140819090430/http://www.chiark.greenend.org.uk/~sgtatham/putty/mirrors.html#guidelines |archive-date=19 August 2014 |access-date=18 August 2014 |publisher=Chiark.greenend.org.uk}}</ref> <syntaxhighlight lang="bash"> $ rsync -auH rsync://rsync.chiark.greenend.org.uk/ftp/users/sgtatham/putty-website-mirror/ . </syntaxhighlight> A way to mimic the capabilities of [[Time Machine (macOS)]];<ref>{{Cite web |title=Rsync set up to run like Time Machine |url=http://blog.interlinked.org/tutorials/rsync_time_machine.html |url-status=live |archive-url=https://web.archive.org/web/20071115224128/http://blog.interlinked.org/tutorials/rsync_time_machine.html |archive-date=15 November 2007 |access-date=18 August 2014 |publisher=Blog.interlinked.org}}</ref> <syntaxhighlight lang="bash"> $ date=$(date "+%FT%H-%M-%S") # rsync interprets ":" as separator between host and port (i.e. host:port), so we cannot use %T or %H:%M:%S here, so we use %H-%M-%S $ rsync -aP --link-dest=$HOME/Backups/current /path/to/important_files $HOME/Backups/back-$date $ ln -nfs $HOME/Backups/back-$date $HOME/Backups/current </syntaxhighlight> Make a full backup of system root directory:<ref>{{Cite web |title=Full system backup with rsync |url=https://wiki.archlinux.org/index.php/Full_system_backup_with_rsync |url-status=live |archive-url=https://web.archive.org/web/20150211163817/https://wiki.archlinux.org/index.php/Full_System_Backup_with_rsync |archive-date=11 February 2015 |access-date=15 December 2014 |publisher=wiki.archlinux.org}}</ref> <syntaxhighlight lang="bash"> $ rsync -avAXHS --progress --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /path/to/backup/folder </syntaxhighlight> Delete all files and directories, within a directory, extremely fast: <syntaxhighlight lang="bash"> # Make an empty directory somewhere, which is the first path, and the second path is the directory you want to empty. $ rsync -a --delete /path/to/empty/dir /path/to/dir/to/empty </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)