Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
other:win10apps [2021/04/17 22:31] – [rsync (Linux !)] Added examples jypeter | other:win10apps [2021/04/26 10:47] – [rsync (Linux !)] Improved jypeter |
---|
==== 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) and ''-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... |
| |
* 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// | * 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)\\ ''rsync %%--%%dry-run -avW -C /mnt/h/test/ /mnt/i/test'' | * 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. Maybe you don't want to use this! | * 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'' | * 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 **copy** the files, without displaying anything\\ ''rsync -aW -C /mnt/h/test/ /mnt/i/test'' |