diff options
author | Richard Kettlewell <rjk@greenend.org.uk> | 2020-09-20 09:43:49 +0100 |
---|---|---|
committer | Richard Kettlewell <rjk@greenend.org.uk> | 2020-09-20 09:43:49 +0100 |
commit | 1bf0d930b4c1fce659f5d789c41a1f39eefb7212 (patch) | |
tree | 20403c76872c628a008dcf45d3b3c9125b68b11f | |
parent | 920fb571b55eb99b842e4bc3df41d912a24dad89 (diff) |
rsync-timeout -> backup-job-timeout
re #80
-rw-r--r-- | doc/CHANGES.md | 1 | ||||
-rw-r--r-- | doc/rsbackup.5 | 2 | ||||
-rwxr-xr-x | scripts/systest | 2 | ||||
-rw-r--r-- | src/ConfBase.cc | 8 | ||||
-rw-r--r-- | src/ConfBase.h | 7 | ||||
-rw-r--r-- | src/ConfDirective.cc | 13 | ||||
-rw-r--r-- | src/MakeBackup.cc | 2 | ||||
-rw-r--r-- | tests/configs/outdent/config | 2 | ||||
-rw-r--r-- | tests/expect/outdent.txt | 10 |
9 files changed, 26 insertions, 21 deletions
diff --git a/doc/CHANGES.md b/doc/CHANGES.md index f0cf85f..027b5ec 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -9,6 +9,7 @@ Please see [rsbackup in git](https://github.com/ewxrjk/rsbackup) for detailed ch * The pruning log in the backup report is now displayed in a less verbose form. Fixes [issue #69](https://github.com/ewxrjk/rsbackup/issues/69). * Warnings about unknown hosts and volumes are more informative. Fixes [issue #79](https://github.com/ewxrjk/rsbackup/issues/79). * The `rsync --link-dest` option is used in a more subtle way. The most recent complete backup is always used if possible, but if there are more recent incomplete backups then the latest of those is used as well. Fixes [issue #77](https://github.com/ewxrjk/rsbackup/issues/77). +* The `rsync-timeout` option has been renamed `backup-job-timeout`. **Advance warning**: In some future version the old name will be removed. ## Changes In rsbackup 7.0 diff --git a/doc/rsbackup.5 b/doc/rsbackup.5 index 006fe13..59cb28c 100644 --- a/doc/rsbackup.5 +++ b/doc/rsbackup.5 @@ -544,7 +544,7 @@ Remove a parameter for pruning policy. The pruning policy to use. See \fBPRUNING\fR below. .TP -.B rsync\-timeout \fIINTERVAL +.B backup\-job\-timeout \fIINTERVAL How long to wait before concluding rsync has hung. The default is 0, which means to wait indefinitely. .TP diff --git a/scripts/systest b/scripts/systest index 3711ed0..690abe5 100755 --- a/scripts/systest +++ b/scripts/systest @@ -73,7 +73,7 @@ logs ${WORK}/logs lock ${WORK}/lock pre-volume-hook ${TOOLS}/rsbackup-snapshot-hook post-volume-hook ${TOOLS}/rsbackup-snapshot-hook -rsync-timeout 60 +backup-job-timeout 60 hook-timeout 60 host-check command ${SCRIPTS}/host-check EOF diff --git a/src/ConfBase.cc b/src/ConfBase.cc index 262270d..5ec5c22 100644 --- a/src/ConfBase.cc +++ b/src/ConfBase.cc @@ -128,10 +128,10 @@ void ConfBase::write(std::ostream &os, int step, bool verbose) const { d(os, "", 0); d(os, "# Maximum time to wait for rsync to complete", step); - d(os, "# rsync-timeout INTERVAL", step); - if(rsyncTimeout) - os << indent(step) << "rsync-timeout " << formatTimeInterval(rsyncTimeout) - << '\n'; + d(os, "# backup-job-timeout INTERVAL", step); + if(backupJobTimeout) + os << indent(step) << "backup-job-timeout " + << formatTimeInterval(backupJobTimeout) << '\n'; d(os, "", 0); d(os, "# Maximum time to wait before giving up on a host", step); diff --git a/src/ConfBase.h b/src/ConfBase.h index 65bb5e9..d2b0739 100644 --- a/src/ConfBase.h +++ b/src/ConfBase.h @@ -51,7 +51,8 @@ public: backupParameters(parent->backupParameters), prunePolicy(parent->prunePolicy), pruneParameters(parent->pruneParameters), preVolume(parent->preVolume), - postVolume(parent->postVolume), rsyncTimeout(parent->rsyncTimeout), + postVolume(parent->postVolume), + backupJobTimeout(parent->backupJobTimeout), rsyncCommand(parent->rsyncCommand), rsyncBaseOptions(parent->rsyncBaseOptions), rsyncExtraOptions(parent->rsyncExtraOptions), @@ -84,8 +85,8 @@ public: /** @brief Post-volume hook */ std::vector<std::string> postVolume; - /** @brief rsync timeout */ - int rsyncTimeout = 0; + /** @brief backup job timeout */ + int backupJobTimeout = 0; /** @brief rsync command */ std::string rsyncCommand = "rsync"; diff --git a/src/ConfDirective.cc b/src/ConfDirective.cc index e5ff426..51d7f73 100644 --- a/src/ConfDirective.cc +++ b/src/ConfDirective.cc @@ -604,14 +604,17 @@ static const struct PostVolumeHookDirective: InheritableDirective { } } post_volume_hook_directive; -/** @brief The @c rsync-timeout directive */ -static const struct RsyncTimeoutDirective: InheritableDirective { - RsyncTimeoutDirective(): InheritableDirective("rsync-timeout", 1, 1) {} +/** @brief The @c backup-job-timeout directive */ +static const struct BackupJobTimeoutDirective: InheritableDirective { + BackupJobTimeoutDirective(): + InheritableDirective("backup-job-timeout", 1, 1) { + alias("rsync-timeout"); + } void set(ConfContext &cc) const override { - cc.context->rsyncTimeout = + cc.context->backupJobTimeout = parseTimeInterval(cc.bits[1], 1, std::numeric_limits<int>::max()); } -} rsync_timeout_directive; +} backup_job_directive; /** @brief The @c hook-timeout directive */ static const struct HookTimeoutDirective: InheritableDirective { diff --git a/src/MakeBackup.cc b/src/MakeBackup.cc index 270855b..9c6cbe9 100644 --- a/src/MakeBackup.cc +++ b/src/MakeBackup.cc @@ -307,7 +307,7 @@ int MakeBackup::rsyncBackup(const std::string &sourcePath) { if(!globalCommand.act) return 0; subprocessIO(sp, true); - sp.setTimeout(volume->rsyncTimeout); + sp.setTimeout(volume->backupJobTimeout); // Make the backup, with the global lock released al.add(&sp); { diff --git a/tests/configs/outdent/config b/tests/configs/outdent/config index 2fd341f..6b509c9 100644 --- a/tests/configs/outdent/config +++ b/tests/configs/outdent/config @@ -1,4 +1,4 @@ -rsync-timeout 7200 +backup-job-timeout 7200 ssh-timeout 60 host alpha volume root / diff --git a/tests/expect/outdent.txt b/tests/expect/outdent.txt index 1379c59..19d5e67 100644 --- a/tests/expect/outdent.txt +++ b/tests/expect/outdent.txt @@ -1,7 +1,7 @@ max-age 3d backup-policy daily prune-policy age -rsync-timeout 2h +backup-job-timeout 2h ssh-timeout 2m rsync-command rsync rsync-base-options --archive --sparse --numeric-ids --compress --fuzzy --hard-links --delete --stats @@ -41,7 +41,7 @@ host alpha max-age 3d backup-policy daily prune-policy age - rsync-timeout 2h + backup-job-timeout 2h ssh-timeout 1m rsync-command rsync rsync-base-options --archive --sparse --numeric-ids --compress --fuzzy --hard-links --delete --stats @@ -55,7 +55,7 @@ host alpha max-age 2d backup-policy daily prune-policy age - rsync-timeout 2h + backup-job-timeout 2h ssh-timeout 1m rsync-command rsync rsync-base-options --archive --sparse --numeric-ids --compress --fuzzy --hard-links --delete --stats @@ -68,7 +68,7 @@ host alpha max-age 1d backup-policy daily prune-policy age - rsync-timeout 2h + backup-job-timeout 2h ssh-timeout 1m rsync-command rsync rsync-base-options --archive --sparse --numeric-ids --compress --fuzzy --hard-links --delete --stats @@ -81,7 +81,7 @@ host beta max-age 3d backup-policy daily prune-policy age - rsync-timeout 2h + backup-job-timeout 2h ssh-timeout 1m rsync-command rsync rsync-base-options --archive --sparse --numeric-ids --compress --fuzzy --hard-links --delete --stats |