Closed shmilee closed 6 days ago
[$] grep --version :) 0 grep (GNU grep) 3.11 [$] rsync_tmbackup-old.sh "/" /some/backup/place grep: warning: stray \ before : grep: warning: stray \ before : df: '': No such file or directory ............
:
@@ -175,7 +175,7 @@ fn_parse_ssh() { # To keep compatibility with bash version < 3, we use grep - if echo "$DEST_FOLDER"|grep -Eq '^[A-Za-z0-9\._%\+\-]+@[A-Za-z0-9.\-]+\:.+$' + if echo "$DEST_FOLDER"|grep -Eq '^[A-Za-z0-9\._%\+\-]+@[A-Za-z0-9.\-]+:.+$' then SSH_USER=$(echo "$DEST_FOLDER" | sed -E 's/^([A-Za-z0-9\._%\+\-]+)@([A-Za-z0-9.\-]+)\:(.+)$/\1/') SSH_HOST=$(echo "$DEST_FOLDER" | sed -E 's/^([A-Za-z0-9\._%\+\-]+)@([A-Za-z0-9.\-]+)\:(.+)$/\2/') @@ -186,7 +186,7 @@ SSH_CMD="ssh -p $SSH_PORT ${SSH_USER}@${SSH_HOST}" fi SSH_DEST_FOLDER_PREFIX="${SSH_USER}@${SSH_HOST}:" - elif echo "$SRC_FOLDER"|grep -Eq '^[A-Za-z0-9\._%\+\-]+@[A-Za-z0-9.\-]+\:.+$' + elif echo "$SRC_FOLDER"|grep -Eq '^[A-Za-z0-9\._%\+\-]+@[A-Za-z0-9.\-]+:.+$' then SSH_USER=$(echo "$SRC_FOLDER" | sed -E 's/^([A-Za-z0-9\._%\+\-]+)@([A-Za-z0-9.\-]+)\:(.+)$/\1/') SSH_HOST=$(echo "$SRC_FOLDER" | sed -E 's/^([A-Za-z0-9\._%\+\-]+)@([A-Za-z0-9.\-]+)\:(.+)$/\2/')
df -T ''
"/"
https://github.com/laurent22/rsync-time-backup/blob/7af3df3644371c7f4f792b617147f0be6da63db9/rsync_tmbackup.sh#L255 https://github.com/laurent22/rsync-time-backup/blob/7af3df3644371c7f4f792b617147f0be6da63db9/rsync_tmbackup.sh#L353-L356 https://github.com/laurent22/rsync-time-backup/blob/7af3df3644371c7f4f792b617147f0be6da63db9/rsync_tmbackup.sh#L379
@@ -252,11 +252,11 @@ } fn_df_t_src() { - fn_run_cmd_src "df -T '${1}'" + fn_run_cmd_src "df -T '${1}/'" } fn_df_t() { - fn_run_cmd "df -T '${1}'" + fn_run_cmd "df -T '${1}/'" }
mv to https://github.com/shmilee/arch-time-backup Implement some new features and fix these issues by myself. Close this. Thanks to laurent22 's script, that helps me a lot!
:
https://github.com/laurent22/rsync-time-backup/blob/7af3df3644371c7f4f792b617147f0be6da63db9/rsync_tmbackup.sh#L178df -T ''
, when src is"/"
https://github.com/laurent22/rsync-time-backup/blob/7af3df3644371c7f4f792b617147f0be6da63db9/rsync_tmbackup.sh#L255 https://github.com/laurent22/rsync-time-backup/blob/7af3df3644371c7f4f792b617147f0be6da63db9/rsync_tmbackup.sh#L353-L356 https://github.com/laurent22/rsync-time-backup/blob/7af3df3644371c7f4f792b617147f0be6da63db9/rsync_tmbackup.sh#L379