Updated md5sums
This commit is contained in:
parent
696b413d9e
commit
68833cf242
20
PKGBUILD
20
PKGBUILD
@ -8,25 +8,25 @@ url="https:/github.com/MatthiasQuintern/msynk"
|
|||||||
license=('GPL3')
|
license=('GPL3')
|
||||||
depends=('rsync')
|
depends=('rsync')
|
||||||
optdepends=('mkrypt: for encryption')
|
optdepends=('mkrypt: for encryption')
|
||||||
source=(msynk.sh _msynk.compdef.zsh)
|
source=(msynk.sh _msynk.compdef.zsh msynk.1.man template)
|
||||||
md5sums=(8a25fcee8c895632f5216933b2058c68 f621c7793781a8e2684eba8c17d6a029)
|
md5sums=(3350dd60fd45dee9e5d7254d8d360da9 f621c7793781a8e2684eba8c17d6a029 1f320b6b18c4535cf38f75f66cdc3c02 492028aa2f08528f1d476376884959b2)
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
mkdir -p "${pkgdir}/usr/bin"
|
mkdir -p "${pkgdir}/usr/bin"
|
||||||
cp "${srcdir}/msynk.sh" "${pkgdir}/usr/bin/msynk"
|
cp "${srcdir}/msynk.sh" "${pkgdir}/usr/bin/msynk"
|
||||||
chmod +x "${pkgdir}/usr/bin/msynk"
|
chmod +x "${pkgdir}/usr/bin/msynk"
|
||||||
|
|
||||||
mkdir -p "${pkgdir}/usr/share/local/man/man1/"
|
mkdir -p "${pkgdir}/usr/share/man/man1/"
|
||||||
cp "msynk.1.man" "${pkgdir}/usr/share/local/man/man1/msynk.1"
|
cp "${srcdir}/msynk.1.man" "${pkgdir}/usr/share/man/man1/msynk.1"
|
||||||
|
|
||||||
mkdir -p "${pkdir}/usr/share/msynk"
|
mkdir -p "${pkgdir}/usr/share/msynk"
|
||||||
cp "template" "${pkdir}/usr/share/msynk/template"
|
cp "${srcdir}/template" "${pkgdir}/usr/share/msynk/template"
|
||||||
chmod +x "${pkdir}/usr/share/msynk/template"
|
chmod +x "${pkgdir}/usr/share/msynk/template"
|
||||||
|
|
||||||
# if using zsh
|
# if using zsh
|
||||||
if [[ -n $ZSH_VERSION ]]; then
|
if [[ -n $ZSH_VERSION ]]; then
|
||||||
mkdir -p "${pkdir}/usr/share/zsh/site-functions"
|
mkdir -p "${pkgdir}/usr/share/zsh/site-functions"
|
||||||
cp "${srcdir}/_msynk.compdef.zsh" "${pkdir}/usr/share/zsh/site-functions/_msynk"
|
cp "${srcdir}/_msynk.compdef.zsh" "${pkgdir}/usr/share/zsh/site-functions/_msynk"
|
||||||
chmod +x "${pkdir}/usr/share/zsh/site-functions/_msynk"
|
chmod +x "${pkgdir}/usr/share/zsh/site-functions/_msynk"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
46
msynk.1.man
46
msynk.1.man
@ -79,7 +79,10 @@ If you just want to add a flag, use rsync_flags+=(-yourflag)
|
|||||||
.PD 0
|
.PD 0
|
||||||
.P
|
.P
|
||||||
.PD
|
.PD
|
||||||
- use_encryption: 0 for no, 1 for yes
|
- use_encryption: 0 for no, 1 for yes\ A template config file is stored
|
||||||
|
in /usr/share/msynk.
|
||||||
|
You can change the location of the configuration directory by replacing
|
||||||
|
$CONFIG_DIR with your directory in /usr/bin/msynk
|
||||||
.SS Example
|
.SS Example
|
||||||
.PP
|
.PP
|
||||||
To sync the directories \[lq]/home/user/foo\[rq]
|
To sync the directories \[lq]/home/user/foo\[rq]
|
||||||
@ -118,9 +121,12 @@ Show a list of arguments.
|
|||||||
Show the current settings.
|
Show the current settings.
|
||||||
.TP
|
.TP
|
||||||
\f[B]-c\f[R], \f[B]\[em]-config\f[R] config-name
|
\f[B]-c\f[R], \f[B]\[em]-config\f[R] config-name
|
||||||
Retrieve settings from config file
|
Retrieve settings from a config file in $CONFIG_DIR, eg
|
||||||
\[ti]/.config/msynk/\f[I]config-name\f[R]
|
\[ti]/.config/msynk/\f[I]config-name\f[R]
|
||||||
.TP
|
.TP
|
||||||
|
\f[B]\[em]-show-config\f[R] config-name
|
||||||
|
Print variables defined from a config with \f[I]config-name\f[R].
|
||||||
|
.TP
|
||||||
\f[B]-s\f[R], \f[B]\[em]-sender\f[R] path
|
\f[B]-s\f[R], \f[B]\[em]-sender\f[R] path
|
||||||
Set sender to directory.
|
Set sender to directory.
|
||||||
This can also be a remote, like user\[at]domain.com:/dir.
|
This can also be a remote, like user\[at]domain.com:/dir.
|
||||||
@ -150,17 +156,19 @@ The files are synced to $TMP_DIR and then decrypted to the receiver
|
|||||||
directory.
|
directory.
|
||||||
Does not work with \[em]-delete.
|
Does not work with \[em]-delete.
|
||||||
.TP
|
.TP
|
||||||
\f[B]\[em]-date\f[R]
|
\f[B]\[em]-check-date\f[R]
|
||||||
Can be used with -c and \[em]-encrypt or \[en]decrypt: When running
|
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
|
\f[B]msynk\f[R] with a config, the current date is stored in the config
|
||||||
file.
|
file.
|
||||||
When running with \[em]-date, only files that have been modified after
|
When running with \[em]-check-date, only files that have been modified
|
||||||
the date stored in the config file are processed (by passing\[en]date
|
after the date stored in the config file are processed (by
|
||||||
[date the config was last run] to \f[I]mkrypt\f[R]).
|
passing\[en]date [date the config was last run] to \f[I]mkrypt\f[R]).
|
||||||
.TP
|
.TP
|
||||||
\f[B]\[em]-mkrypt-flags\f[R] flags
|
\f[B]\[em]-mkrypt-flag\f[R] arg
|
||||||
Additional flags for \f[I]mkrypt\f[R].
|
Additional argument for \f[I]mkrypt\f[R], for example to set the key for
|
||||||
You can use this to set the key for the encryption.
|
the encryption.
|
||||||
|
Only pass one argument at a time, so for passing two use
|
||||||
|
`\[em]-mkrypt-flag \[lq]arg1\[rq] \[en]mkrypt-flag \[lq]arg2\[rq]'
|
||||||
.TP
|
.TP
|
||||||
\f[B]-d\f[R], \f[B]\[em]-delete\f[R]
|
\f[B]-d\f[R], \f[B]\[em]-delete\f[R]
|
||||||
\f[I]rsync\f[R] \[em]-delete option.
|
\f[I]rsync\f[R] \[em]-delete option.
|
||||||
@ -173,9 +181,11 @@ will be deleted and prompt you wether you want continue (unless
|
|||||||
Can be used with \[em]-delete.
|
Can be used with \[em]-delete.
|
||||||
This skips listing the files that will be deleted and the prompt.
|
This skips listing the files that will be deleted and the prompt.
|
||||||
.TP
|
.TP
|
||||||
\f[B]\[em]-rsync-flags\f[R] flags
|
\f[B]\[em]-rsync-flag\f[R] arg
|
||||||
Additional flags for \f[I]rsync\f[R].
|
Additional argument for \f[I]rsync\f[R], for example to set the port for
|
||||||
You can use this to set the port for the connection.
|
the connection.
|
||||||
|
Only pass one argument at a time, so for passing two use
|
||||||
|
`\[em]-rsync-flag \[lq]arg1\[rq] \[en]rsync-flag \[lq]arg2\[rq]'
|
||||||
.TP
|
.TP
|
||||||
\f[B]-v\f[R], \f[B]\[em]-verbose\f[R]
|
\f[B]-v\f[R], \f[B]\[em]-verbose\f[R]
|
||||||
Increase verbosity: Passes -v to rsync and mkrypt.
|
Increase verbosity: Passes -v to rsync and mkrypt.
|
||||||
@ -198,6 +208,18 @@ are given, all files are synced.
|
|||||||
If you are not using a config file: pos.
|
If you are not using a config file: pos.
|
||||||
args.
|
args.
|
||||||
are filepaths relative to the sender directory.
|
are filepaths relative to the sender directory.
|
||||||
|
.SH Troubleshooting
|
||||||
|
.SS Not enough space when using encryption
|
||||||
|
.PP
|
||||||
|
When using \[em]-encrypt, the data is encrypted to a temporary directory
|
||||||
|
$TMP_DIR, when using \[en]decrypt the encrypted date is copied to the
|
||||||
|
$TMP_DIR and then decrypted.
|
||||||
|
The $TMP_DIR defaults to /tmp/mksynk and /tmp is usually limited to half
|
||||||
|
the size of your memory.
|
||||||
|
You change the $TMP_DIR in the script in /usr/bin/msynk or temporarily
|
||||||
|
increase the size of the tmpfs by running \[lq]sudo mount -o
|
||||||
|
remount,size=XXG,noatime /tmp\[rq] if your $TMP_DIR is on /tmp and you
|
||||||
|
have at least XXGB memory+swap space.
|
||||||
.SH COPYRIGHT
|
.SH COPYRIGHT
|
||||||
.PP
|
.PP
|
||||||
Copyright \[co] 2022 Matthias Quintern.
|
Copyright \[co] 2022 Matthias Quintern.
|
||||||
|
7
msynk.sh
7
msynk.sh
@ -103,7 +103,8 @@ sync_sender_to_receiver()
|
|||||||
printf "$FMT_ERROR" "Invalid path: $path"; exit 1
|
printf "$FMT_ERROR" "Invalid path: $path"; exit 1
|
||||||
fi
|
fi
|
||||||
if [[ -n $encrypt || -n $decrypt ]]; then
|
if [[ -n $encrypt || -n $decrypt ]]; then
|
||||||
[[ -d "$path" ]] && tmp_source="$TMP_DIR"
|
mkdir -p "$TMP_DIR"
|
||||||
|
tmp_source="$TMP_DIR"
|
||||||
|
|
||||||
if [[ -n $encrypt ]]; then
|
if [[ -n $encrypt ]]; then
|
||||||
# check if TMP_DIR has enough space
|
# check if TMP_DIR has enough space
|
||||||
@ -124,7 +125,7 @@ sync_sender_to_receiver()
|
|||||||
[[ -f $path ]] && tmp_source=$TMP_DIR$(basename $path)
|
[[ -f $path ]] && tmp_source=$TMP_DIR$(basename $path)
|
||||||
[[ $v -ge 3 ]] && printf "$FMT_CMD" "rsync ${rsync_flags[*]} $path $TMP_DIR"
|
[[ $v -ge 3 ]] && printf "$FMT_CMD" "rsync ${rsync_flags[*]} $path $TMP_DIR"
|
||||||
rsync "${rsync_flags[@]}" "$path" "$TMP_DIR" || { printf "$FMT_ERROR" "rsync exited with exit code $?"; exit 2; }
|
rsync "${rsync_flags[@]}" "$path" "$TMP_DIR" || { printf "$FMT_ERROR" "rsync exited with exit code $?"; exit 2; }
|
||||||
[[ $v -ge 3 ]] && printf "$FMT_CMD" "bash $mkrypt --decrypt $tmp_source --output $(readlink -f $dest) ${mkrypt_flags[@]}"
|
[[ $v -ge 3 ]] && printf "$FMT_CMD" "bash $mkrypt --decrypt $tmp_source --output $(readlink -f $dest) ${mkrypt_flags[*]}"
|
||||||
bash $mkrypt --decrypt "$tmp_source" --output "$(readlink -f "$dest")" ${mkrypt_flags[@]} || exit 3
|
bash $mkrypt --decrypt "$tmp_source" --output "$(readlink -f "$dest")" ${mkrypt_flags[@]} || exit 3
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
@ -326,7 +327,7 @@ if [[ -n $config ]]; then
|
|||||||
if [[ $use_encryption = 1 ]]; then
|
if [[ $use_encryption = 1 ]]; then
|
||||||
[[ -z $reverse ]] && encrypt=1 || decrypt=1
|
[[ -z $reverse ]] && encrypt=1 || decrypt=1
|
||||||
fi
|
fi
|
||||||
[[ $v -ge 3 ]] && printf "$FMT_MESSAGE" "Loaded config:" "$CONFIG_DIR$config:: date:$date sender:$sender receiver:$receiver use_encryption:$use_encryption encrypt:$encrypt decrypt:$decrypt paths:${paths[*]}"
|
[[ $v -ge 3 ]] && printf "$FMT_MESSAGE" "Loaded config:" "$CONFIG_DIR$config: date:$date sender:$sender receiver:$receiver use_encryption:$use_encryption encrypt:$encrypt decrypt:$decrypt paths:${paths[*]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# overwrite stuff from the config if anything else was given / set variables of no config was given
|
# overwrite stuff from the config if anything else was given / set variables of no config was given
|
||||||
|
Loading…
Reference in New Issue
Block a user