Merge branch 'master' of github.com:vishap/scripts

This commit is contained in:
2021-01-16 15:18:31 +00:00
13 changed files with 291 additions and 87 deletions

View File

@@ -1,7 +1,7 @@
#!/bin/bash
DATE=/bin/date
RSYNC=/usr/bin/rsync
RSYNC=/usr/bin/rsync
TIMESTAMP=`$DATE +%Y%m%d-%H:%M%z`
LOGFILE=/mnt/hdd/backup/log/backup.$TIMESTAMP.log
@@ -21,14 +21,13 @@ function backup() {
$RSYNC -aAXv --delete --force $ORIG_DIR $MIRROR_DIR | $LOG
}
function backuphdd() {
HDD_ORIG=/mnt/hdd
HDD_MIRROR=/mnt/hdd2
ORIG_DIR=$HDD_ORIG/$1
MIRROR_DIR=$HDD_MIRROR/$(dirname $1)
function backupwd() {
ORIG_DIR=$1
MIRROR_DIR=192.168.0.6:/DataVolume/$2
backup $ORIG_DIR $MIRROR_DIR
}
#
# Log Header
#
@@ -59,4 +58,3 @@ done
# Log Footer
#
echo end `$DATE` | $LOG

View File

@@ -1,10 +1,16 @@
#!/bin/bash
set -x
if [ "$1" != "no-progress" ]; then
PROG=--progress
else
shift
fi
if [ ! -z "$*" ]; then
for i in "$@"; do
/usr/bin/rsync -av --inplace --progress --append-verify "/mnt/ssd/deluge/done/$i" "hrat:tmp/tmp/done/"
done
else
echo "/usr/bin/rsync -av --inplace --append-verify /mnt/ssd/deluge/done hrat:tmp/tmp"
/usr/bin/rsync -av --inplace --append-verify $PROG /mnt/ssd/deluge/done hrat:tmp/tmp
fi