summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md3
-rwxr-xr-xrsync_tmbackup.sh12
2 files changed, 15 insertions, 0 deletions
diff --git a/README.md b/README.md
index 7feae3d..b55558e 100644
--- a/README.md
+++ b/README.md
@@ -26,6 +26,9 @@ On macOS, it has a few disadvantages compared to Time Machine - in particular it
not be managed by the script - in particular they will not be
automatically deleted.
Default: /home/backuper/.rsync_tmbackup
+ --log-to-destination Set the log file directory to the destination directory. If this flag
+ is set, generated files will not be managed by the script - in particular
+ they will not be automatically deleted.
--strategy Set the expiration strategy. Default: "1:1 30:7 365:30" means after one
day, keep one backup per day. After 30 days, keep one backup every 7 days.
After 365 days keep one backup every 30 days.
diff --git a/rsync_tmbackup.sh b/rsync_tmbackup.sh
index be0a0da..1335766 100755
--- a/rsync_tmbackup.sh
+++ b/rsync_tmbackup.sh
@@ -46,6 +46,9 @@ fn_display_usage() {
echo " not be managed by the script - in particular they will not be"
echo " automatically deleted."
echo " Default: $LOG_DIR"
+ echo " --log-to-destination Set the log file directory to the destination directory. If this flag"
+ echo " is set, generated files will not be managed by the script - in particular"
+ echo " they will not be automatically deleted."
echo " --strategy Set the expiration strategy. Default: \"1:1 30:7 365:30\" means after one"
echo " day, keep one backup per day. After 30 days, keep one backup every 7 days."
echo " After 365 days keep one backup every 30 days."
@@ -277,6 +280,7 @@ DEST_FOLDER=""
EXCLUSION_FILE=""
LOG_DIR="$HOME/.$APPNAME"
AUTO_DELETE_LOG="1"
+LOG_TO_DEST="0"
EXPIRATION_STRATEGY="1:1 30:7 365:30"
AUTO_EXPIRE="1"
@@ -318,6 +322,10 @@ while :; do
LOG_DIR="$1"
AUTO_DELETE_LOG="0"
;;
+ --log-to-destination)
+ LOG_TO_DEST="1"
+ AUTO_DELETE_LOG="0"
+ ;;
--no-auto-expire)
AUTO_EXPIRE="0"
;;
@@ -439,6 +447,10 @@ MYPID="$$"
# Create log folder if it doesn't exist
# -----------------------------------------------------------------------------
+if [[ $LOG_TO_DEST == "1" ]]; then
+ LOG_DIR="$DEST_FOLDER/.$APPNAME"
+fi
+
if [ ! -d "$LOG_DIR" ]; then
fn_log_info "Creating log folder in '$LOG_DIR'..."
mkdir -- "$LOG_DIR"