Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Rsync
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Rsync
(section)
Add topic