]> arthur.barton.de Git - backup-script.git/commitdiff
New configuration variable "[default_]io_timeout"
authorAlexander Barton <alex@barton.de>
Wed, 25 May 2016 08:25:01 +0000 (10:25 +0200)
committerAlexander Barton <alex@barton.de>
Wed, 25 May 2016 08:25:01 +0000 (10:25 +0200)
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
bin/backup-script

index de10ad2ee87b7e2b3af35d0e4da3652232b1ffc9..c6602d818e80eec8bc4549b88a1fccefaed1b018 100644 (file)
--- 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
index f585d42a815935277a386c5efe1ea6eb6e6626c0..8edf4d1122bdd2b9cffe7ee1580fee0a0724d187 100755 (executable)
@@ -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"