From fc7ec050f1747ff5296cbdfaca41717766546c8d Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Wed, 25 May 2016 10:25:01 +0200 Subject: [PATCH] New configuration variable "[default_]io_timeout" Tis allows setting of the maximum I/O timeout in seconds. If no data is transferred for the specified time then rsync will abort. This patch also changes the default from 900 to 1800 seconds (30 min). --- README.md | 5 +++++ bin/backup-script | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index de10ad2..c6602d8 100644 --- a/README.md +++ b/README.md @@ -167,6 +167,11 @@ Supported file systems are: The latest snapshot is always reachable using a symlink named `latest` inside the system directory. +### [default_]io_timeout + +The maximum I/O timeout in seconds. If no data is transferred for the specified +time then rsync will abort. Default: 1800 (30 minutes). + ### [default_]tags Comma-separated list of tags of this job. All uppercase tag names are reserved diff --git a/bin/backup-script b/bin/backup-script index f585d42..8edf4d1 100755 --- a/bin/backup-script +++ b/bin/backup-script @@ -45,6 +45,7 @@ default_compress=1 default_ping=1 default_local=0 default_generations=0 +default_io_timeout="1800" default_job_pre_exec="" default_job_post_exec="" default_tags="" @@ -399,6 +400,7 @@ for f in "${sys[@]}"; do job_pre_exec="$default_job_pre_exec" job_post_exec="$default_job_post_exec" tags="$default_tags" + io_timeout="$default_io_timeout" # Compatibility with backup-pull(1) script: Save global values ... pre_exec_saved="$pre_exec" @@ -571,7 +573,7 @@ for f in "${sys[@]}"; do # prepare (remote) command ... if [[ "$backup_type" == "rsync" ]]; then - cmd="$rsync --archive --timeout=900" + cmd="$rsync --archive --timeout=$io_timeout" [ "$compress" -ne 0 ] && cmd="$cmd --compress" [ "$local" -eq 0 ] && cmd="$cmd --rsh=\"$ssh_cmd\"" cmd="$cmd --delete-during --delete-excluded --sparse" -- 2.39.2