diff --git a/msynk.1 b/msynk.1 index d5d6e3a..e1bbedd 100644 --- a/msynk.1 +++ b/msynk.1 @@ -4,7 +4,7 @@ .hy .SH NAME .PP -msynk - sync files locally or between devices +\f[B]msynk\f[R] - rsync helper that supports encryption and presets .SH SYNOPSIS .PP Local: @@ -75,7 +75,7 @@ synced .P .PD - rsync_flags: array containing all the flags for rsync. -If you just want to add a flag, use \[aa]rsync_flags+=(-yourflag) +If you just want to add a flag, use rsync_flags+=(-yourflag) .PD 0 .P .PD @@ -131,6 +131,7 @@ Set the receiver directory. All files and directories will be placed inside this directory. This can also be a remote, like user\[at]domain.com:/dir. This option always needs to be set. +Note that this directory must already exist if it is on a remote. .TP \f[B]\[em]-reverse\f[R] Swaps sender and receiver. @@ -149,6 +150,14 @@ The files are synced to $TMP_DIR and then decrypted to the receiver directory. Does not work with \[em]-delete. .TP +\f[B]\[em]-date\f[R] +Can be used with -c and \[em]-encrypt or \[en]decrypt: When running +\f[B]msynk\f[R] with a config, the current date is stored in the config +file. +When running with \[em]-date, only files that have been modified after +the date stored in the config file are processed (by passing\[en]date +[date the config was last run] to \f[I]mkrypt\f[R]). +.TP \f[B]\[em]-mkrypt-flags\f[R] flags Additional flags for \f[I]mkrypt\f[R]. You can use this to set the key for the encryption. @@ -191,6 +200,12 @@ args. are filepaths relative to the sender directory. .SH COPYRIGHT .PP -Alles meins!!! +Copyright \[co] 2022 Matthias Quintern. +License GPLv3+: GNU GPL version 3 . +.PD 0 +.P +.PD +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. .SH AUTHORS Matthias Quintern. diff --git a/README.md b/msynk.1.md similarity index 83% rename from README.md rename to msynk.1.md index 536082e..7586f81 100644 --- a/README.md +++ b/msynk.1.md @@ -3,7 +3,7 @@ % March 2022 # NAME -msynk - sync files locally or between devices +**msynk** - rsync helper that supports encryption and presets # SYNOPSIS | Local: @@ -32,7 +32,7 @@ The config files are shellscripts run with bash to set certain environent variab - paths: array containing all paths (relative to sender) that should be synced\ - sender: the parent directory of the paths\ - receiver: the path where the files should be synced to\ -- rsync_flags: array containing all the flags for rsync. If you just want to add a flag, use ´rsync_flags+=(-yourflag)\ +- rsync_flags: array containing all the flags for rsync. If you just want to add a flag, use rsync_flags+=(-yourflag)\ - use_encryption: 0 for no, 1 for yes ### Example @@ -57,7 +57,7 @@ You can then run this with: "msynk -c my_backup"\, or if you only want to sync t : 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. +: 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. **--reverse** : Swaps sender and receiver. Useful when you want to reverse a config file. @@ -70,6 +70,10 @@ You can then run this with: "msynk -c my_backup"\, or if you only want to sync t : 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. +**--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 --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-flags** flags : Additional flags for *mkrypt*. You can use this to set the key for the encryption. @@ -96,4 +100,5 @@ You can then run this with: "msynk -c my_backup"\, or if you only want to sync t : If you are not using a config file: pos. args. are filepaths relative to the sender directory. # COPYRIGHT -Alles meins!!! +Copyright © 2022 Matthias Quintern. License GPLv3+: GNU GPL version 3 .\ +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..f97210a --- /dev/null +++ b/readme.md @@ -0,0 +1,88 @@ +**msynk** - rsync helper that supports encryption and presets + +# DESCRIPTION +**msynk** uses *rsync* to synchronise files or directories locally or between devices. +In general, you should always add a trailing '/' to directories. + +## Encryption +Files can also be encrypted or decrypted using *mkrypt*. If encryption is used, the files are encrypted to a temporary directory and then synced with *rsync*. +If you sync encrypted files to your system, the encrypted files are transferred with *rsync* to a temporary directory and then decrypted to your filesystem. + +## Configuration Files +**msynk** can read from config files usually stored in ~/.config/msynk. +The config files are shellscripts run with bash to set certain environent variables. These are: +- paths: array containing all paths (relative to sender) that should be synced +- sender: the parent directory of the paths +- receiver: the path where the files should be synced to +- rsync_flags: array containing all the flags for rsync. If you just want to add a flag, use rsync_flags+=(-yourflag) +- use_encryption: 0 for no, 1 for yes + +### Example +To sync the directories "/home/user/foo" "/home/user/bar" and the file "/home/user/file.txt" to a remote server "user@foobar.com:~/backup" which is available with ssh at port 42, you could have a configuration file "my_backup": +```bash + sender=/home/user/ + receiver=user@foobar.com:~/backup/ + paths=(foo/ bar/ file.txt) + rsync_flags+=(--rsh="ssh -p 42") +``` +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 +**-h**, **--help** +: Show a list of arguments. + +**--settings** +: Show the current settings. + +**-c**, **--config** config-name +: Retrieve settings from config file ~/.config/msynk/*config-name* + +**-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. + +**--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. + +**--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 --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-flags** flags +: Additional flags for *mkrypt*. You can use this to set the key for the encryption. + +**-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-flags** flags +: Additional flags for *rsync*. You can use this to set the port for the connection. + +**-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. + +## COPYRIGHT +Copyright © 2022 Matthias Quintern. License GPLv3+: GNU GPL version 3 .\ +This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.