Improved options section

This commit is contained in:
matthias@arch 2022-04-04 03:26:25 +02:00
parent 56fb2a7c22
commit 696b413d9e

View File

@ -30,65 +30,24 @@ To sync the directories "/home/user/foo" "/home/user/bar" and the file "/home/us
You can then run this with: `msynk -c my_backup`, or if you only want to sync the "foo" directory and ".txt" files: `msynk -c my_backup foo .txt` You can then run this with: `msynk -c my_backup`, or if you only want to sync the "foo" directory and ".txt" files: `msynk -c my_backup foo .txt`
## OPTIONS ## OPTIONS
**-h**, **--help** - `-h, --help` Show a list of arguments.
: Show a list of arguments. - `--settings` Show the current settings.
- `-c, --config config-name` Retrieve settings from config file ~/.config/msynk/*config-name*
**--settings** - `--show-config config-name` Print variables defined from a config with *config-name*.
: Show the current settings. - `-s, --sender path` Set sender to directory. This can also be a remote, like user@domain.com:/dir. Defaults to to the current working directory.
- `-r, --receiver path` Set the receiver directory. All files and directories will be placed inside this directory. This can also be a remote, like user@domain.com:/dir. This option always needs to be set. Note that this directory must already exist if it is on a remote.
**-c**, **--config** config-name - `--reverse` Swaps sender and receiver. Useful when you want to reverse a config file.
: Retrieve settings from config file ~/.config/msynk/*config-name* - `--encrypt` Encrypt files with *mkrypt* before sending them to the receiver. The files are encrypted to $TMP_DIR and then synced to the receiver. Does not work with --delete.
- `--decrypt` Decrypt files with *mkrypt* after receiving them from the sender. Assumes that all files are encrypted and fails if that is not the case. The files are synced to $TMP_DIR and then decrypted to the receiver directory. Does not work with --delete.
**--show-config** config-name - `--check-date` Can be used with -c and --encrypt or --decrypt: When running msynk with a config, the current date is stored in the config file. When running with --check-date, only files that have been modified after the date stored in the config file are processed (by passing--date [date the config was last run] to *mkrypt*).
: Print variables defined from a config with *config-name*. - `--mkrypt-flag arg` Additional argument for *mkrypt*, for example to set the key for the encryption. Only pass one argument at a time, so for passing two use `--mkrypt-flag "arg1" --mkrypt-flag "arg2"`
- `-d, --delete` *rsync* --delete option. Deletes all files on the receiver that do not exist on the sender. *msynk* will open *less* with a list of all files that will be deleted and prompt you wether you want continue (unless --skip-dryrun is set)
**-s**, **--sender** path - `--skip-dryrun` Can be used with --delete. This skips listing the files that will be deleted and the prompt.
: Set sender to directory. This can also be a remote, like user@domain.com:/dir. Defaults to to the current working directory. - `--rsync-flag arg` Additional argument for *rsync*, for example to set the port for the connection. Only pass one argument at a time, so for passing two use `--rsync-flag "arg1" --rsync-flag "arg2"`
- `-v, --verbose` Increase verbosity: Passes -v to rsync and mkrypt.
**-r**, **--receiver** path - `--silent` Decrease verbosity: Print only error messages and passes --silent to mkrypt.
: Set the receiver directory. All files and directories will be placed inside this directory. This can also be a remote, like user@domain.com:/dir. This option always needs to be set. Note that this directory must already exist if it is on a remote. - `--debug` Maximum verbosity: -v but also print out rsync and mkrypt commands.
- `positional arguments` If you are using a config file: pos. args. are strings that have to be contained in a path in order for it to be synced. If no pos. args. are given, all files are synced. If you are not using a config file: pos. args. are filepaths relative to the sender directory.
**--reverse**
: Swaps sender and receiver. Useful when you want to reverse a config file.
**--encrypt**
: Encrypt files with *mkrypt* before sending them to the receiver.
: The files are encrypted to $TMP_DIR and then synced to the receiver. Does not work with --delete.
**--decrypt**
: Decrypt files with *mkrypt* after receiving them from the sender. Assumes that all files are encrypted and fails if that is not the case.
: The files are synced to $TMP_DIR and then decrypted to the receiver directory. Does not work with --delete.
**--check-date**
: Can be used with -c and --encrypt or --decrypt: When running **msynk** with a config, the current date is stored in the config file.
: When running with --check-date, only files that have been modified after the date stored in the config file are processed (by passing--date [date the config was last run] to *mkrypt*).
**--mkrypt-flag** arg
: Additional argument for *mkrypt*, for example to set the key for the encryption.
: Only pass one argument at a time, so for passing two use `--mkrypt-flag "arg1" --mkrypt-flag "arg2"`
**-d**, **--delete**
: *rsync* --delete option. Deletes all files on the receiver that do not exist on the sender. *msynk* will open *less* with a list of all files that will be deleted and prompt you wether you want continue (unless --skip-dryrun is set)
**--skip-dryrun**
: Can be used with --delete. This skips listing the files that will be deleted and the prompt.
**--rsync-flag** arg
: Additional argument for *rsync*, for example to set the port for the connection.
: Only pass one argument at a time, so for passing two use `--rsync-flag "arg1" --rsync-flag "arg2"`
**-v**, **--verbose**
: Increase verbosity: Passes -v to rsync and mkrypt.
**--silent**
: Decrease verbosity: Print only error messages and passes --silent to mkrypt.
**--debug**
: Maximum verbosity: -v but also print out rsync and mkrypt commands.
**positional arguments**
: If you are using a config file: pos. args. are strings that have to be contained in a path in order for it to be synced. If no pos. args. are given, all files are synced.
: If you are not using a config file: pos. args. are filepaths relative to the sender directory.
## Troubleshooting ## Troubleshooting
### Not enough space when using encryption ### Not enough space when using encryption