User Tools

Site Tools


other:win10apps

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
other:win10apps [2021/04/17 20:01]
jypeter Added rsync
other:win10apps [2021/04/26 08:47]
jypeter [rsync (Linux !)] Improved
Line 142: Line 142:
 ==== rsync (Linux !) ==== ==== rsync (Linux !) ====
  
-''​rsync''​ is a convenient Linux command that can be used for mirroring a directory hierarchy to another location on the same computer (e.g. a removable disk) or a remote server. It can also be used on a Windows 10 computer where [[other:​win10wsl|WSL + Ubuntu is installed]]! ​But it is probably ​easier to use the //​mirroring//​ option of [[other:​win10_syncback|SyncBack]].+''​rsync''​ is a convenient ​**Linux** command that can be used for //mirroring// a directory hierarchy to another location on the same computer (e.g. a removable disk) or a remote server. It can also be used on a Windows 10 computer where [[other:​win10wsl|WSL + Ubuntu is installed]]! ​On Windows, ​it is easier to use the //​mirroring//​ option of [[other:​win10_syncback|SyncBack]]
 + 
 +//​Mirroring//​ means in the ''​rsync''​ case that we will **only copy new or changed files**. The first //copy// may take some time, but will be much faster afterwards, when only a few files have been created/​changed and have to be copied. Or, if a copy is interrupted,​ the files already copied will not be copied a second time.
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-Warning! It'​s ​easy to lose files with ''​rsync''​ if you use the wrong syntax or options! Be sure to understand the basic options, and use ''​%%--%%dry-run''​ (simulate what would be done)''​-v''​ (verbose) before performing an actual synchronization+**Warning!** It is easy to lose files with ''​rsync''​ if you use the wrong syntax or options! 
 + 
 +Mirroring //no files// by mistake, to a place where there are files, with the ''​%%--%%delete''​ option, means that existing files or whole directory hierarchies will be deleted! 
 + 
 +  * Be sure to understand the basic options, and use ''​%%--%%dry-run''​ (simulate what would be done) and ''​-v''​ (verbose) before performing an actual synchronization 
 +  * <wrap em>​Having a trailing ''/''​ or not behind a directory name makes a difference!</​wrap>​
  
 Use ''​man rsync''​ for more options and details... Use ''​man rsync''​ for more options and details...
 </​WRAP>​ </​WRAP>​
  
 +=== Some rsync options ===
 +
 +Use ''​man rync''​ for more details and options
 +
 +<​code>​
 +-a, --archive ​              ​archive mode; equals -rlptgoD (no -H,-A,-X)
 +        -r, --recursive ​            ​recurse into directories
 +        -l, --links ​                copy symlinks as symlinks
 +        -p, --perms ​                ​preserve permissions
 +        -t, --times ​                ​preserve modification times
 +        -g, --group ​                ​preserve group
 +        -o, --owner ​                ​preserve owner (super-user only)
 +            --devices ​              ​preserve device files (super-user only)
 +            --specials ​             preserve special files
 +        -D                          same as --devices --specials
 +
 +
 +-v, --verbose ​              ​increase verbosity
 +-z, --compress ​             compress file data during the transfer
 +-W, --whole-file ​           copy files whole (w/o delta-xfer algorithm)
 +-C, --cvs-exclude ​          ​auto-ignore files in the same way CVS does
 +             RCS SCCS CVS CVS.adm RCSLOG cvslog.* tags TAGS .make.state .nse_depinfo *~ #* .#* ,*  _$*
 +             ​*$ ​ *.old  *.bak  *.BAK *.orig *.rej .del-* *.a *.olb *.o *.obj *.so *.exe *.Z *.elc *.ln
 +             core .svn/ .git/ .hg/ .bzr/
 +
 +--delete ​               delete extraneous files from dest dirs
 +
 +-n, --dry-run ​              ​perform a trial run with no changes made
 +-c, --checksum ​             skip based on checksum, not mod-time & size
 +</​code>​
 +
 +=== Examples ===
 +
 +  * We have an existing //source// ''/​mnt/​h/​test/''​ directory that we would like to //mirror// to another disk or //​destination//,​ as ''/​mnt/​i/​test/''​.\\ i.e we want to recursively copy the content of ''​test/''​ to a ''​test/''​ directory //somewhere else// ​
 +    * Show what would be done, but do not do it (yet)\\ <wrap em>Note that we have a trailing ''/''​ after the source directory, and NO ''/''​ after the destination directory</​wrap>​\\ ''​rsync %%--%%dry-run -avW -C /​mnt/​h/​test/​ /​mnt/​i/​test''​
 +      * Note: using ''​-C''​ makes sure  that files and directories considered as temporary will not be copied.\\ Do NOT use the ''​-C''​ option if you really want to copy all the files!
 +    * Same as above, without the //verbose// mode. Probably nothing will be displayed on the screen\\ ''​rsync %%--%%dry-run -aW -C /​mnt/​h/​test/​ /​mnt/​i/​test''​
 +    * Actually **copy** the files, without displaying anything\\ ''​rsync -aW -C /​mnt/​h/​test/​ /​mnt/​i/​test''​
 +    * Actually **mirror** the content of the //source// directory.\\ **Warning! Warning!** the ''​%%--%%delete''​ option will make sure that files present in the destination directory, but not in the source directory will be deleted! Be careful, make some tests and use the ''​%%--%%dry-run''​ option before using this\\ ''​rsync -aW -C %%--%%delete /​mnt/​h/​test/​ /​mnt/​i/​test''​
 ===== PuTTY & Pageant ===== ===== PuTTY & Pageant =====
  
other/win10apps.txt · Last modified: 2024/03/05 15:04 by jypeter