If we want to immediately proceed to sync with default Unison settings without any interactive prompt, where non-conflicting changes will be propagated and conflicts will be skipped, we can pass -batch=true as an option: $. Let’s delete and modify some files, then sync again: Nothing to do: replicas have not changed since last sync. Once it’s done, if we try to sync again, it’ll say nothing to sync: $. Synchronization complete at 15:29:09 (6 items transferred, 0 skipped, 0 failed) Copying file0C.bin from ~/target to ~/source Copying file0B.bin from ~/target to ~/source Copying file0A.bin from ~/target to ~/source Copying file03.bin from ~/source to ~/target Copying file02.bin from ~/source to ~/target Copying file01.bin from ~/source to ~/target We press f or Enter to confirm each change. If we press Enter, it will ask for confirmation for each change that we want to do. We can press Enter to continue, or q to quit. This can happen either because this is the first time you have synchronized these roots, or because you have upgraded Unison to a new version with a different archive format.ĭonations to the Unison project are gratefully accepted: Warning: No archive files were found for these roots, whose canonical names are: Whenever we sync a new source and target directory for the first time, which Unison refers to as a profile, we’ll get this interactive prompt: $. To demonstrate its usage, let’s say we have the following structure of source and target directories: $ tree This is particularly useful if we need to verify that the command will succeed without any errors, such as incorrect options, or insufficient disk space, or any other potential issues. The output in the last line, (DRY RUN), indicates that it’s a dry run. Total size is 0 speedup is 0.00 (DRY RUN) Sent 189 bytes received 28 bytes 434.00 bytes/sec -v: display detailed information of what is being doneĪdditionally, we can also do a dry run by passing the -n option, which will simulate the sync with no changes made: $ rsync -Pcauvn source/ target/.-D: preserve device files and special files.-c: skip object based on checksum, not on modified time and size.-P: display statistics of the whole transfer rather than individual files.Sent 401 bytes received 73 bytes 948.00 bytes/secĪs a result of the rsync command that we ran twice in both directions, both directories are now identical. Sent 297 bytes received 76 bytes 746.00 bytes/sec $ touch target/file0A.bin target/file0B.bin target/file0C.bin $ touch source/file01.bin source/file02.bin source/file03.bin To illustrate the sync operation, let’s first create a sample directory structure: $ mkdir source target
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |