Skip to content

Commit

Permalink
Custom log-file be used as 7th parameter. Will replace default log-fi…
Browse files Browse the repository at this point in the history
…le if set.
  • Loading branch information
kevin39 committed May 16, 2020
1 parent 3b4d952 commit 6e9c7e7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions rclone_jobber.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ move_old_files_to="$3" #move_old_files_to is one of:
# "dated_files" - move old files to old_files directory, and append move date to file names (an incremental backup)
# "" - old files are overwritten or deleted (a plain one-way sync backup)
options="$4" #rclone options like "--filter-from=filter_patterns --checksum --log-level="INFO" --dry-run"
#do not put these in options: --backup-dir, --suffix, --log-file
#do not put these in options: --backup-dir, --suffix
job_name="$5" #job_name="$(basename $0)"
monitoring_URL="$6" #cron monitoring service URL to send email if cron failure or other error prevented back up
custom_log_file="$7" #use a custom log file

################################ set variables ###############################
# $new is the directory name of the current snapshot
Expand All @@ -38,7 +39,12 @@ log_file="${path%.*}.log" #replace path extension with "log"
#log_file="/var/log/rclone_jobber.log" #for Logrotate

# set log_option for rclone
log_option="--log-file=$log_file" #log to log_file
if ! [ -z "$custom_log_file" ];
then
log_option="--log-file=$custom_log_file"
else
log_option="--log-file=$log_file"
fi
#log_option="--syslog" #log to systemd journal

################################## functions #################################
Expand Down

0 comments on commit 6e9c7e7

Please sign in to comment.