Compare commits
78 commits
f-andrey-m
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c78676ab9d | ||
|
|
2dec3ed145 | ||
|
|
c56e78a463 | ||
|
|
27785d0ad0 | ||
|
|
4dd6ed1ee2 | ||
|
|
5cad03cb3e | ||
|
|
f71dd556dc | ||
|
|
77ecc4318f | ||
|
|
99b2512789 | ||
|
|
4779ee4d1b | ||
|
|
96a64148fd | ||
|
|
6140c226db | ||
|
|
18ef8983aa | ||
|
|
734be37b6d | ||
|
|
9fea5075ab | ||
|
|
ae37de0e65 | ||
|
|
2a77dde6ee | ||
|
|
e070ca7887 | ||
|
|
5a023c3609 | ||
|
|
6377ad5281 | ||
|
|
649c7830b0 | ||
|
|
dba25a57de | ||
|
|
13af8206e3 | ||
|
|
9a36453bb1 | ||
|
|
a7752c4c78 | ||
|
|
06291f0a6e | ||
|
|
cd82c07579 | ||
|
|
de7a6be9fe | ||
|
|
98bcf9f673 | ||
|
|
0c4f2b7c45 | ||
|
|
2389ee61db | ||
|
|
def00abe60 | ||
|
|
e4df413036 | ||
|
|
dd2189ec4d | ||
|
|
f8c4d0cc16 | ||
|
|
723945af44 | ||
|
|
b7c292b5ff | ||
|
|
cc2ae25355 | ||
|
|
d1311a185a | ||
|
|
25d63bb99f | ||
|
|
2ad58dc07e | ||
|
|
418ab79b11 | ||
|
|
6ba17fa268 | ||
|
|
b207b90cba | ||
|
|
fb54103607 | ||
|
|
d2ae7c58c1 | ||
|
|
a827d886f4 | ||
|
|
5a5244e164 | ||
|
|
26dc5cab55 | ||
|
|
cddd3f3c74 | ||
|
|
277677350c | ||
|
|
fb54765c53 | ||
|
|
4bdde466e2 | ||
|
|
0f901f4f78 | ||
|
|
4d5ab6247d | ||
|
|
5d20128634 | ||
|
|
6c7eea2401 | ||
|
|
b39300c514 | ||
|
|
6421242e02 | ||
|
|
e92a4c49b3 | ||
|
|
4fbb5ed190 | ||
|
|
17e40b3c67 | ||
|
|
6b7c1c66b2 | ||
|
|
f9c07e28fa | ||
|
|
73adf5dc99 | ||
|
|
f4c999b2c5 | ||
|
|
6ce9a646cd | ||
|
|
562d6d05f2 | ||
|
|
1238c14af6 | ||
|
|
4f96d724b3 | ||
|
|
465ae13b78 | ||
|
|
c9bd2a49f2 | ||
|
|
637336a45d | ||
|
|
4c99612258 | ||
|
|
2f07d0e216 | ||
|
|
9e02ee3296 | ||
|
|
1604d024d7 | ||
|
|
7a84fbdfa8 |
6 changed files with 717 additions and 243 deletions
11
.travis.yml
11
.travis.yml
|
|
@ -3,16 +3,11 @@ language: bash
|
|||
# Use container-based infrastructure for quicker build start-up
|
||||
sudo: false
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- debian-sid
|
||||
packages:
|
||||
- shellcheck
|
||||
before_script:
|
||||
- shellcheck --version
|
||||
|
||||
script:
|
||||
- shellcheck -e SC2153 duplicity-backup.sh
|
||||
- shellcheck -e SC2034 duplicity-backup.conf.example
|
||||
- shellcheck -e SC2034 duplicity-backup.sh duplicity-backup.conf.example
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
|
|
|
|||
81
CHANGELOG
81
CHANGELOG
|
|
@ -1,3 +1,63 @@
|
|||
vX.X.X (unreleased)
|
||||
===================
|
||||
|
||||
v1.6.0 (2018-05-22)
|
||||
===================
|
||||
* Add support for Dropbox backend (by xmatthias)
|
||||
* Fix issue #177: bug in `--cleanup` action (thanks smcgrat)
|
||||
|
||||
v1.5.0 (2018-01-15)
|
||||
===================
|
||||
* Add support for B2 backend (by harrim4n)
|
||||
|
||||
v1.4.3 (2017-10-30)
|
||||
===================
|
||||
* Add support for Telegram notifications (by GerardRibas)
|
||||
|
||||
v1.4.2 (2017-10-30)
|
||||
===================
|
||||
* Remove VERSION file and hardcode it directly in the script. Fix issue #164 (thanks regelga)
|
||||
|
||||
v1.4.1 (2017-10-04)
|
||||
===================
|
||||
* Show program versions in output.
|
||||
|
||||
v1.4.0 (2017-09-24)
|
||||
===================
|
||||
* Add version check of duplicity to handle deprecation of --include-globbing-filelist
|
||||
* Bugfixes
|
||||
|
||||
v1.3.0 (2016-10-23)
|
||||
===================
|
||||
* Fix GPG error when backing up the script if no specific keyring is set up.
|
||||
* Attempt to fix issue #145 by adding a `GPG_OPTIONS` parameter.
|
||||
* Add `-h` / `--help` option to print usage and don't send email or notification when printing usage only
|
||||
* Rename repository from 'duplicity-backup' to 'duplicity-backup.sh'.
|
||||
|
||||
v1.2 (2016-09-10)
|
||||
=================
|
||||
* Changed: big rework of logging handling. Now done through I/O-redirection of file descriptors 1 to 5.
|
||||
* Fix: Add case for s-nail when using mailx.
|
||||
* Fix: Always exclude /proc from Source Disk Use Information.
|
||||
* Fix issue #140: Add --no-show-photos to --gpg-options.
|
||||
* Fix "line 89: 4: Bad file descriptor" when printing usage without config set up.
|
||||
|
||||
v1.1 (2016-09-03)
|
||||
===================
|
||||
* Fix and improve handling of INCLIST and EXCLIST (issue #128)
|
||||
* Fix shellcheck error SC2166
|
||||
* Fix shellcheck error SC2128
|
||||
* Fix shellcheck SC2153 and SC1090
|
||||
* Restart versionning and keeping a changelog
|
||||
* Add option "--version" or "-V" to show version information about this script and duplicity
|
||||
|
||||
0.9.x (2013-01-14 to 2016-08-31)
|
||||
================================
|
||||
Versionning and keeping a changelog up to date has been neglected between 2013-01-14 and 2016-08-31.
|
||||
|
||||
There were no official 0.9.x release, but an automatically generated list of changes that affected
|
||||
`duplicity-backup.sh` or `duplicity-backup.conf.example` is available in the file `CHANGELOG_0.9.x.md`.
|
||||
|
||||
0.8.3 (02 January 2013)
|
||||
======================
|
||||
* FreeBSD portability (du, mail, & shebang) [barofsoap]
|
||||
|
|
@ -18,8 +78,10 @@
|
|||
|
||||
0.8 (05 August 2012)
|
||||
===================
|
||||
* Improved argument parsing. Now the script is insensitive to the order of appearance of the options and handles correctly optional options parameters
|
||||
* Re-added possibility to specify the config file on the command line, which is now the recommended way to do (facilitating script updates)
|
||||
* Improved argument parsing. Now the script is insensitive to the order of appearance of the options and handles
|
||||
correctly optional options parameters
|
||||
* Re-added possibility to specify the config file on the command line, which is now the recommended way to do
|
||||
(facilitating script updates)
|
||||
* Added dry-run command line option (-n or --dry-run)
|
||||
* Added many short versions of long options (-b, -f, -v, -l, -s)
|
||||
* Fix "unary operator expected warning" in some rare cases
|
||||
|
|
@ -39,12 +101,14 @@ Inclusion of two patches written by [shamer] + modified config file management.
|
|||
|
||||
* Added option to use ssmtp to send mail [shamer]
|
||||
* Added lock file to prevent running multiple instances simultaneously [shamer]
|
||||
* Modified config file management (no more specified on the command line, must be specified as an parameter at the beginning of the script)
|
||||
* Modified config file management (no more specified on the command line, must be specified as an parameter at the
|
||||
beginning of the script)
|
||||
* Fixed bad check_variables() behaviour when not using Amazon S3 storage backend without commenting AWS API keys
|
||||
|
||||
0.6 Version Six (4 May 2012)
|
||||
============================
|
||||
This is a rework of the script to include some github patches that were brought to the original script in order to make the script more generic than only Amazon S3 oriented and fix a few issues.
|
||||
This is a rework of the script to include some github patches that were brought to the original script in order to make
|
||||
the script more generic than only Amazon S3 oriented and fix a few issues.
|
||||
|
||||
* Added ability not to encrypt the backup [orkaa]
|
||||
* Added ability to use backup destination locations other than Amazon S3 [orkaa]
|
||||
|
|
@ -85,15 +149,18 @@ Version Three (01/31/09)
|
|||
* Added comment to explain why folks need to use 's3+' and not 's3:' for Amazon buckets
|
||||
* Used "unset" to remove the variables at end of the script
|
||||
* Fixed a problem when the backup folder on S3 was nested inside another bucket
|
||||
* Changed the PASSPHRASE field to default to the actual passphrase, so one can easily backup the entire script and not have to worry about the passphrase.
|
||||
* Added --backup-this-script option which will turn the script and the secret key into an encrypted tarball that can be kept somewhere safe for easy restores if the machine goes down.
|
||||
* Changed the PASSPHRASE field to default to the actual passphrase, so one can easily backup the entire script and
|
||||
not have to worry about the passphrase.
|
||||
* Added --backup-this-script option which will turn the script and the secret key into an encrypted tarball that can
|
||||
be kept somewhere safe for easy restores if the machine goes down.
|
||||
* Cleaned up the get_file_size function so it wouldn't run when it wasn't supposed to.
|
||||
|
||||
Version Two (12/03/08)
|
||||
======================
|
||||
|
||||
* added GPL license
|
||||
* changed the cleanup feature to automatically force a full backup after (n) number of days as well as automatically cleanup after (n) number of days
|
||||
* changed the cleanup feature to automatically force a full backup after (n) number of days as well as automatically
|
||||
cleanup after (n) number of days
|
||||
* added option to force cleanup after (n) number of full backups (rather than by days)
|
||||
* option to changed log file ownership
|
||||
* runtime checks for installed required software and write permissions on log directory
|
||||
|
|
|
|||
107
CHANGELOG_0.9.x.md
Normal file
107
CHANGELOG_0.9.x.md
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
Between version 0.10.0 and 0.8.3, versionning had been neglected and no CHANGELOG entry was kept up to date.
|
||||
|
||||
Here is an export from `git log` for all changes that affected `duplicity-backup.sh` or `duplicity-backup.conf.example` between 2013-01-14 and 2016-08-31.
|
||||
|
||||
```
|
||||
2016-08-31 23:03:09 +0200 - 73adf5d - Fixes related to new warnings coming from the new version of shellcheck
|
||||
2016-08-31 17:09:28 -0300 - 6ce9a64 - Wrong identation
|
||||
2016-08-31 16:36:29 -0300 - 4f96d72 - Send notification if stale lock is detected
|
||||
2016-08-31 15:26:12 -0300 - 465ae13 - Add IFTTT notification service
|
||||
2016-08-31 15:13:34 -0300 - c9bd2a4 - Add IFTTT notification service
|
||||
2016-07-13 18:23:27 +0200 - 2f07d0e - Adding -e, --cleanup flag...
|
||||
2016-07-03 01:07:08 +0200 - 1604d02 - Support mailx from mailutils
|
||||
2016-06-15 13:38:18 +0200 - 7a84fbd - Fix for issue #128
|
||||
2016-04-29 15:31:56 +0200 - dcdc081 - changed my mind about where to place NOTIFICATION_SERVICE
|
||||
2016-04-29 15:27:40 +0200 - b90289d - minor comment changes to notifications
|
||||
2016-04-28 15:58:49 -0400 - 0501d23 - fixed error
|
||||
2016-04-28 21:28:54 +0200 - 6dc6d19 - Restore the functionality to specify a custom mail script
|
||||
2016-04-23 14:15:09 -0400 - 3ffde78 - Adding Pushover notifications
|
||||
2016-04-06 11:05:19 -0400 - a719668 - added -r flag to bash read to allow backslashes in GPG passphrases
|
||||
2016-04-01 23:21:19 +0200 - fad4bd2 - Full rework of email handling
|
||||
2016-03-28 23:47:39 +0200 - f3f4ddc - rework code for email and notifications (more DRY)
|
||||
2016-03-28 23:21:02 +0200 - 74f637d - Typo
|
||||
2016-03-25 20:40:46 +0100 - bcd64c1 - first iteration after activation of Travis-CI
|
||||
2016-03-25 20:00:39 +0100 - 6c63877 - one last cleaning in the conf file with shellcheck
|
||||
2016-03-25 19:47:29 +0100 - 3797960 - massive cleaning with shellcheck: from 5 errors and 200 warnings to zero
|
||||
2016-03-24 21:12:17 +0100 - 454d278 - minor changes to the pull request before merging
|
||||
2016-03-24 20:59:42 +0100 - 471cc9f - minor changes to the pull request before merging
|
||||
2016-03-16 18:01:49 +0530 - 491b045 - Add storage class option for AWS S3 to specify storage class to be used
|
||||
2016-02-26 14:56:31 +0800 - 3eabe0d - Add config sample for Slack notifications
|
||||
2016-02-26 14:54:34 +0800 - fcfa9ac - Add Slack incoming webhook notifications support
|
||||
2016-02-26 14:44:46 +0800 - 4fca444 - Better comment
|
||||
2016-01-27 10:50:15 -0500 - ff1e827 - Adding support for custom mail scripts.
|
||||
2016-01-23 15:12:03 +1100 - 931fe9e - added ftps and ftpes to list of possible destinations
|
||||
2015-10-19 13:59:34 +0800 - 423a1d3 - Fix typo
|
||||
2015-10-10 13:31:12 +0200 - 3a48d5a - Fix bug #106 (unary operator expected)
|
||||
2015-10-08 10:15:56 +0200 - e5d5785 - also send email on cleanup failure + replace introduced tabs with spaces
|
||||
2015-09-02 10:17:14 +0200 - 8985d9c - - added EMAIL_FAILURE_ONLY option to send e-mails only if there was an error while doing backup - added HOSTNAME option to inform in e-mail report for which server is this report for - e-mail subject is rewrited now to know if backup was OK or not
|
||||
2015-08-17 14:58:00 -0500 - 689eb23 - add more backslashes to unweildy awk script
|
||||
2015-07-29 21:56:53 +0200 - 498ac97 - Rework of duplicity-backup.conf.example, no functionality changes
|
||||
2015-07-29 15:38:48 +0200 - 5bdb816 - Add OpenStack Swift support
|
||||
2015-07-05 20:08:51 +0200 - 0dfa26a - change mode of script to 755
|
||||
2015-06-24 13:33:06 +0200 - 0644d76 - Make tar stdin/stdout explicit in backup function
|
||||
2015-05-21 09:09:10 +0200 - 19951b7 - Fix issue #94
|
||||
2015-05-18 18:40:23 +0200 - a69eeaa - Delete trailing spaces
|
||||
2015-05-18 18:17:34 +0200 - 4be3671 - Fix bug #93 : make message about unsupported destination disk usage more explicit
|
||||
2015-05-14 16:17:20 +0200 - 2be958e - Human readable size for Google Cloud
|
||||
2015-05-14 16:16:56 +0200 - 01143b6 - Size GCS with gsutil
|
||||
2015-05-14 14:16:59 +0200 - 8abfd40 - Google Cloud Storage support
|
||||
2015-04-20 13:33:44 -0400 - 528cc41 - Move --exclude-device-files to beginning of EXCLUDE variable
|
||||
2015-04-17 08:54:36 -0500 - c8d249d - removed perl dependancy
|
||||
2015-04-13 17:13:08 -0500 - 20ded18 - Appending usage information to EMAIL_SUBJECT modified: duplicity-backup.sh
|
||||
2015-04-10 15:26:28 -0500 - a749d24 - Add support for getting size of remote disk connected via ssh
|
||||
2015-01-27 15:23:11 +0000 - e94732a - Add destination type to disk use report and make format consistent with source du report
|
||||
2015-01-27 13:13:18 +0000 - 08cb675 - improve s3cmd not installed message, ie mention PATH
|
||||
2015-01-26 19:20:44 +0000 - 3fcfb22 - add s3cmd config not found to dest disk use report
|
||||
2015-01-23 19:12:57 +0000 - 92a3932 - unset ftp_password variable
|
||||
2015-01-23 17:02:25 +0000 - 258e68c - copy whole array rather than one element
|
||||
2015-01-23 16:25:51 +0000 - ea14212 - remove not on -z INCLIST check
|
||||
2015-01-21 16:29:42 +0100 - 2e6e383 - Rework on the pull request to refactor the new code
|
||||
2015-01-21 15:59:42 +0100 - b34c7a5 - Include the include/exclude globbing file in the backup tarball if present
|
||||
2015-01-19 20:13:52 +0000 - 6f5b0dc - My typo in code comment - du not df
|
||||
2015-01-19 19:08:23 +0000 - 01ec946 - Correct log reports of file size to disk use, plus some log file formatting cleanups
|
||||
2015-01-19 18:36:11 +0000 - 646f8c4 - Excluded directories were no excluded from source disk usage report - quotes issue
|
||||
2015-01-19 17:17:56 +0000 - 6ccf691 - Don't skip source disk use report when INCLIST unconfigured
|
||||
2015-01-18 18:01:32 +0000 - bdcb1bf - Update example config with log dir creation info
|
||||
2015-01-18 14:50:35 +0000 - d3c2102 - If we create the log dir chown it to log file owner
|
||||
2014-12-05 09:39:05 +1100 - 59f2339 - add an option to set the tmpdir for duplicity to use.
|
||||
2014-12-05 09:30:05 +1100 - 83b7ecd - doing a collection status and file list need to eval the command (like all the other commands already do) because if you have ssh options set in your config, it causes an error ("duplicity: error: no such option: -o")
|
||||
2014-08-10 03:08:38 +0200 - 7b20db3 - fix: ensure a trailing slash in log dir name
|
||||
2014-06-06 12:11:58 +0300 - 456f5cd - Add a note in configuration about escaping "$" in passphrase
|
||||
2014-06-06 12:09:04 +0300 - 615a988 - Add Google Docs destination to configuration
|
||||
2014-06-06 12:03:18 +0300 - a148ac8 - Fix typos, remove trailing whitespace
|
||||
2014-04-16 15:05:23 +0200 - 1bde60d - Add REMOVE_LOGS_OLDER_THAN parameter to the config file
|
||||
2014-03-30 14:44:31 -0400 - 9f5626b - Add option to remove old log files.
|
||||
2014-03-30 14:44:17 -0400 - 36f87c7 - Only change log file ownership if necessary.
|
||||
2014-03-30 14:43:53 -0400 - b20f7ab - Clarification when remote size unavailable.
|
||||
2014-03-04 12:22:14 +0100 - 4f90cc7 - add support for DragonFly and OpenBSD
|
||||
2014-02-05 16:59:34 +0100 - 3bfd78c - duplicity-backup.sh: Fix quotation issue
|
||||
2014-01-06 17:24:51 -0500 - 2209955 - dont include --sign-key when restoring w/ hidden-enc key
|
||||
2014-01-03 16:25:26 -0500 - 417d526 - only cleanup if CLEAN_UP_TYPE and CLEAN_UP_VARIABLE are defined
|
||||
2014-01-03 15:26:26 -0500 - 1864e3a - added HIDE_KEY_ID and SECRET_KEYRING options
|
||||
2014-01-02 16:16:23 +0200 - 07c1fd2 - Added the option to skip cleanup
|
||||
2013-11-22 10:32:19 +0100 - 1bd7c26 - Fixes issue zertrin/duplicity-backup/issues/41 - conf revert
|
||||
2013-11-22 10:29:07 +0100 - 7d83629 - Fixes issue zertrin/duplicity-backup/issues/41
|
||||
2013-11-13 21:56:12 +0100 - 54f9aaf - Complete the half-done work of previous commit
|
||||
2013-11-13 21:36:34 +0100 - 03ef054 - Add the --restore-dir synonym and update the documentation accordingly
|
||||
2013-11-13 20:08:34 +0100 - e9af0ab - Some little modifications and additions in the doc of the config file
|
||||
2013-11-13 19:55:47 +0100 - dd05ff6 - Add support for mail sending via msmtp
|
||||
2013-11-13 19:36:15 +0100 - 5c99b4c - fixed variable name (cherry picked from commit 19c80a83a2819bdac73dfe4bc08e270205a9a666)
|
||||
2013-11-11 00:06:31 +0000 - 22e3904 - Renamed the --dry-run option to --debug.Created proper duplicity --dry-run command (recommended -v8, info verbosity level)
|
||||
2013-08-12 11:06:09 +0200 - c3aa58b - Small improvements to the fix of cippino before merge
|
||||
2013-08-02 10:52:08 +0200 - 0275cb5 - Fixed INCLIST
|
||||
2013-07-22 11:59:41 +0200 - dbf78cf - Better explanation of the FTP_PASSWORD variable based on official documentation
|
||||
2013-07-22 10:20:29 +0200 - 63d38be - Add notes about the difference between "mailx" and "mail" commands
|
||||
2013-07-22 10:11:31 +0200 - 68931e4 - Move the new section about remove-all-inc-of-but-n-full a bit lower in the config file.
|
||||
2013-07-21 19:58:46 -0500 - 9b34c04 - Adds the option to use remove-all-inc-of-but-n-full to prune incrementals of backups with long history.
|
||||
2013-07-09 11:52:03 -0300 - 582416f - A small contribution with a set a ftp variable to run on a script
|
||||
2013-07-07 19:03:42 +0200 - 7275aaf - sendmail error
|
||||
2013-07-03 09:21:20 +0200 - 31da9c8 - Sendmail as mail command
|
||||
2013-05-14 22:12:27 -0500 - e636dd4 - Fix typos.
|
||||
2013-03-31 01:24:26 +0100 - 89a78ed - Be a bit more specific about configuration problems
|
||||
2013-03-31 01:21:43 +0100 - 7bb45ff - Let s3cmd have the correct bucket name when using s3 scheme
|
||||
2013-03-23 00:14:23 +0100 - ee1b759 - Fix issue #38 : Multiple recipients
|
||||
2013-01-29 14:32:05 +0100 - bc0fa15 - Fix for du --exclude-from and mail on OS X
|
||||
2013-01-14 21:25:36 +0100 - 02fae5c - Update duplicity-backup.sh
|
||||
2013-01-14 01:04:56 +0100 - 6df0902 - Fix issue #33 : Allow to specify the s3cmd configuration file
|
||||
```
|
||||
71
README.md
71
README.md
|
|
@ -1,4 +1,4 @@
|
|||
[](https://travis-ci.org/zertrin/duplicity-backup)
|
||||
[](https://travis-ci.org/zertrin/duplicity-backup.sh)
|
||||
|
||||
# duplicity-backup.sh
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ This means the following:
|
|||
|
||||
## Contributing
|
||||
|
||||
The development version of the code is available at https://github.com/zertrin/duplicity-backup in the `dev` branch. It is a bleeding-edge version with the latests changes that have not yet been tested a lot, but that's the best starting point to contribute.
|
||||
The development version of the code is available at https://github.com/zertrin/duplicity-backup.sh in the `dev` branch. It is a bleeding-edge version with the latest changes that have not yet been tested a lot, but that's the best starting point to contribute.
|
||||
|
||||
Pull requests are welcome! However please **always use individual feature branches for each pull request**. I may not accept a pull request from a master or dev branch.
|
||||
|
||||
|
|
@ -39,12 +39,12 @@ Here is how to do it:
|
|||
|
||||
Fork the repository first and then clone your fork on your machine:
|
||||
|
||||
git clone git@github.com:YOURNAME/duplicity-backup.git
|
||||
git clone git@github.com:YOURNAME/duplicity-backup.sh.git duplicity-backup
|
||||
cd duplicity-backup
|
||||
|
||||
Add a remote for the upstream repository:
|
||||
|
||||
git remote add upstream git@github.com:zertrin/duplicity-backup.git
|
||||
git remote add upstream git@github.com:zertrin/duplicity-backup.sh.git
|
||||
git fetch upstream
|
||||
|
||||
Create a new topic branch for the changes you want to make, based on the `dev` branch from upstream:
|
||||
|
|
@ -57,7 +57,7 @@ Make your changes, test them, commit them and push them to Github:
|
|||
|
||||
Open a Pull request from `YOURNAME:my-fix-1` to `zertrin:dev`.
|
||||
|
||||
If you want to open another pull request for another change which is independant of the previous one, just create another topic branch based on master (`git checkout -b my-fix-2 upstream/dev`)
|
||||
If you want to open another pull request for another change which is independent of the previous one, just create another topic branch based on master (`git checkout -b my-fix-2 upstream/dev`)
|
||||
|
||||
|
||||
## Installation
|
||||
|
|
@ -66,22 +66,25 @@ If you want to open another pull request for another change which is independant
|
|||
|
||||
You can clone the repository (which makes it easy to get future updates):
|
||||
|
||||
git clone https://github.com/zertrin/duplicity-backup.git duplicity-backup
|
||||
git clone https://github.com/zertrin/duplicity-backup.sh.git duplicity-backup
|
||||
|
||||
If you prefer the stable version do:
|
||||
If you prefer the stable (but old) version do:
|
||||
|
||||
git checkout stable
|
||||
|
||||
... or if you want the latest version (might still have bugs), then:
|
||||
... or if you want the normal version, then:
|
||||
|
||||
git checkout master
|
||||
|
||||
... or if you like living on the edge, you can stay at the development version which is automatically cloned.
|
||||
... or if you like living on the edge (or need the latest bugfixes), you can stay at the development version which is automatically cloned.
|
||||
|
||||
Or just download the ZIP file:
|
||||
|
||||
* For the stable branch: https://github.com/zertrin/duplicity-backup/archive/stable.zip
|
||||
* For the normal branch: https://github.com/zertrin/duplicity-backup/archive/master.zip
|
||||
| Version | Download link |
|
||||
|---------------|-------------------------------------------------------------------|
|
||||
| stable (old) | https://github.com/zertrin/duplicity-backup.sh/archive/stable.zip |
|
||||
| normal | https://github.com/zertrin/duplicity-backup.sh/archive/master.zip |
|
||||
| latest | https://github.com/zertrin/duplicity-backup.sh/archive/dev.zip |
|
||||
|
||||
### 2. Configure the script
|
||||
|
||||
|
|
@ -94,7 +97,7 @@ The script looks for its configuration by reading the path to the config file sp
|
|||
If no config file was given on the command line, the script will try to find the file specified in the `CONFIG` parameter at the beginning of the script (default: `duplicity-backup.conf` in the script's directory).
|
||||
|
||||
So be sure to either:
|
||||
* specify the configuration file path on the command line with the -c option **[recommended]**
|
||||
* specify the configuration file path on the command line with the `-c` option **[recommended]**
|
||||
* or to edit the `CONFIG` parameter in the script to match the actual location of your config file. **[deprecated]** _(will be removed in future versions of the script)_
|
||||
|
||||
NOTE: to ease future updates of the script, you may prefer NOT to edit the script at all and to specify systematically the path to your config file on the command line with the `-c` or `--config` option.
|
||||
|
|
@ -120,13 +123,13 @@ else just download again the ZIP archive an extract it over the existing folder.
|
|||
|
||||
Then compare the example config file (`duplicity-backup.conf.example`) with your modified version (for example `/etc/duplicity-backup.conf`) and adapt your copy to reflect the changes in the example file.
|
||||
|
||||
Thare are many ways to do so, here are some examples (adapt the path to your actual files):
|
||||
There are many ways to do so, here are some examples (adapt the path to your actual files):
|
||||
|
||||
diff duplicity-backup.conf.example /etc/duplicity-backup.conf
|
||||
vimdiff duplicity-backup.conf.example /etc/duplicity-backup.conf
|
||||
|
||||
|
||||
## Dependancies
|
||||
## Dependencies
|
||||
|
||||
* [duplicity](http://duplicity.nongnu.org/)
|
||||
* Basic utilities like: [bash](https://www.gnu.org/software/bash/), [which](http://unixhelp.ed.ac.uk/CGI/man-cgi?which), [find](https://www.gnu.org/software/findutils/) and [tee](http://linux.die.net/man/1/tee) (should already be available on most Linux systems)
|
||||
|
|
@ -136,6 +139,9 @@ Thare are many ways to do so, here are some examples (adapt the path to your act
|
|||
For the [Amazon S3](https://aws.amazon.com/s3/) storage backend *`optional`*
|
||||
* [s3cmd](http://s3tools.org/s3cmd) *`optional`*
|
||||
|
||||
For the [Backblaze B2](https://www.backblaze.com/b2) storage backend *`optional`*
|
||||
* [python-b2](https://pypi.python.org/pypi/b2) *`optional`*
|
||||
|
||||
For the [Google Cloud Storage](https://cloud.google.com/storage/) storage backend *`optional`*
|
||||
* [boto](https://github.com/boto/boto) (may already have been installed with duplicity)
|
||||
* [gsutil](https://cloud.google.com/storage/docs/gsutil) *`optional`*
|
||||
|
|
@ -144,30 +150,36 @@ For the [Google Cloud Storage](https://cloud.google.com/storage/) storage backen
|
|||
## Usage
|
||||
|
||||
duplicity-backup.sh [options]
|
||||
|
||||
|
||||
Options:
|
||||
-c, --config CONFIG_FILE specify the config file to use
|
||||
|
||||
|
||||
-b, --backup runs an incremental backup
|
||||
-f, --full forces a full backup
|
||||
-v, --verify verifies the backup
|
||||
-e, --cleanup cleanup the backup (eg. broken sessions), by default using
|
||||
duplicity --force flag, use --dry-run to actually log what
|
||||
will be cleaned up without removing (see man duplicity
|
||||
> ACTIONS > cleanup for details)
|
||||
-l, --list-current-files lists the files currently backed up in the archive
|
||||
-s, --collection-status show all the backup sets in the archive
|
||||
|
||||
|
||||
--restore [PATH] restores the entire backup to [path]
|
||||
--restore-file [FILE_TO_RESTORE] [DESTINATION]
|
||||
restore a specific file
|
||||
--restore-dir [DIR_TO_RESTORE] [DESTINATION]
|
||||
restore a specific directory
|
||||
|
||||
|
||||
-t, --time TIME specify the time from which to restore or list files
|
||||
(see duplicity man page for the format)
|
||||
|
||||
|
||||
--backup-script automatically backup the script and secret key(s) to
|
||||
the current working directory
|
||||
|
||||
|
||||
-n, --dry-run perform a trial run with no changes made
|
||||
-d, --debug echo duplicity commands to logfile
|
||||
|
||||
-V, --version print version information about this script and duplicity
|
||||
|
||||
|
||||
## Usage Examples
|
||||
|
|
@ -220,26 +232,39 @@ Note that the commands `--restore-file` and `--restore-dir` are equivalent.
|
|||
|
||||
duplicity-backup.sh [-c config_file] --verify
|
||||
|
||||
**Clean the backup**
|
||||
|
||||
duplicity-backup.sh [-c config_file] --cleanup
|
||||
|
||||
**Backup the script and gpg key in a encrypted tarfile (for safekeeping)**
|
||||
|
||||
duplicity-backup.sh [-c config_file] --backup-script
|
||||
|
||||
|
||||
## Cron Usage Example
|
||||
## Cron Usage Example (backup)
|
||||
|
||||
41 3 * * * /absolute/path/to/duplicity-backup.sh -c /etc/duplicity-backup.conf -b
|
||||
|
||||
## Cron Usage Example (cleanup)
|
||||
|
||||
41 4 * * 1 /absolute/path/to/duplicity-backup.sh -c /etc/duplicity-backup.conf -e
|
||||
|
||||
|
||||
## Known issues
|
||||
|
||||
### GPG error if system locale is not english
|
||||
|
||||
If your system's locale is not english, an error can happen when duplicity is trying to encrypt the files with gpg. This problem concerns duplicity and has been reported upstream ([see bug report](https://bugs.launchpad.net/duplicity/+bug/510625)). A simple workaround is to set the following environement variable: `LANG=C`. For example: `LANG=C duplicity-backup.sh [-c config_file] ...` or in the cron `41 3 * * * LANG=C /absolute/path/to/duplicity-backup.sh -c /etc/duplicity-backup.conf -b`
|
||||
|
||||
### "/dev/fd/62: Operation not supported" errors on FreeBSD
|
||||
|
||||
See [issue #143](https://github.com/zertrin/duplicity-backup.sh/issues/143) for a fix.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
This script attempts to simplify the task of running a duplicity command; if you are having any problems with the script the first step is to determine if the script is generating an incorrect command or if duplicity itself is causing your error.
|
||||
|
||||
To see exactly what is happening when you run duplicity-backup, either pass the option `-d` or `--debug` on the command line, or head to the bottom of the configuration file and uncomment the `ECHO=$(which echo)` variable.
|
||||
To see exactly what is happening when you run duplicity-backup.sh, either pass the option `-d` or `--debug` on the command line, or head to the bottom of the configuration file and uncomment the `ECHO=$(which echo)` variable.
|
||||
|
||||
This will stop the script from running and will, instead, output the generated command into your log file. You can then check to see if what is being generated is causing an error or if it is duplicity causing you woe.
|
||||
|
||||
|
|
@ -252,5 +277,5 @@ You can also try the `-n` or `--dry-run` option. This will make duplicity to cal
|
|||
* Show backup-ed files in today incremental backup email
|
||||
|
||||
|
||||
###### Thanks to all the [contributors](https://github.com/zertrin/duplicity-backup/graphs/contributors) for their help.
|
||||
###### Thanks to all the [contributors](https://github.com/zertrin/duplicity-backup.sh/graphs/contributors) for their help.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# Copyright (c) 2008-2010 Damon Timm.
|
||||
# Copyright (c) 2010 Mario Santagiuliana.
|
||||
# Copyright (c) 2012-2015 Marc Gallet.
|
||||
# Copyright (c) 2012-2018 Marc Gallet.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
|
|
@ -23,10 +23,10 @@
|
|||
# http://damontimm.com/code/dt-s3-backup (for the original program by Damon Timm)
|
||||
#
|
||||
# Latest code available at:
|
||||
# http://github.com/zertrin/duplicity-backup
|
||||
# http://github.com/zertrin/duplicity-backup.sh
|
||||
#
|
||||
# List of contributors:
|
||||
# https://github.com/zertrin/duplicity-backup/graphs/contributors
|
||||
# https://github.com/zertrin/duplicity-backup.sh/graphs/contributors
|
||||
#
|
||||
# ---------------------------------------------------------------------------- #
|
||||
|
||||
|
|
@ -60,7 +60,7 @@
|
|||
# See the `STATIC_OPTIONS`, `CLEAN_UP_TYPE` and `CLEAN_UP_VARIABLE` parameters in particular.
|
||||
#
|
||||
# * Before asking something about duplicity-backup.sh, ensure that your question
|
||||
# isn’t actually concerning duplicity ;)
|
||||
# isn't actually concerning duplicity ;)
|
||||
# First, make sure you can perform a backup with duplicity without using this script.
|
||||
# If you can't make the backup work with duplicity alone, the problem is probably
|
||||
# concerning duplicity and not this script. If you manage to make a backup with duplicity
|
||||
|
|
@ -75,7 +75,7 @@
|
|||
# This can be / or somewhere else -- I use /home/ because all the
|
||||
# directories that I want to backup start with /home/.
|
||||
#
|
||||
ROOT="/home"
|
||||
ROOT='/home'
|
||||
|
||||
# Set hostname for this duplicity instance, useful for e-mail reports
|
||||
#
|
||||
|
|
@ -108,13 +108,14 @@ DEST="s3+http://foobar-backup-bucket/backup-folder/"
|
|||
#DEST="ftpes://user[:password]@other.host[:port]/some_dir"
|
||||
#DEST="rsync://user@host.com[:port]//absolute_path"
|
||||
#DEST="scp://user[:password]@other.host[:port]/[/]some_dir"
|
||||
#DEST="ssh://user[:password]@other.host[:port]/[/]some_dir"
|
||||
#DEST="sftp://user[:password]@other.host[:port]/[/]some_dir"
|
||||
#DEST="file:///home/foobar_user_name/new-backup-test/"
|
||||
#DEST="imap[s]://user[:password]@host.com[/from_address_prefix]"
|
||||
#DEST="webdav[s]://user[:password]@other.host[:port]/some_dir"
|
||||
#DEST="gdocs://foobar_google_account/some_dir"
|
||||
#DEST="swift://foobar_swift_container/some_dir"
|
||||
#DEST="dpbx:///foobar_swift_container/some_dir"
|
||||
#DEST="b2://some_account_id[:some_application_key]@some_bucket_name/some_dir"
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
|
@ -122,13 +123,13 @@ DEST="s3+http://foobar-backup-bucket/backup-folder/"
|
|||
# ------------------------------------------------------------------------------
|
||||
# Instead of setting the password needed for the backup destination in the
|
||||
# DEST url, you can supply it in the FTP_PASSWORD variable below, which is
|
||||
# used by most, if not all backends, regardless of it’s name.
|
||||
# used by most, if not all backends, regardless of its name.
|
||||
# Duplicity's official documentation states:
|
||||
# "Supported by most backends which are password capable. More secure than
|
||||
# setting it in the backend url (which might be readable in the operating
|
||||
# systems process listing to other users on the same machine)."
|
||||
#
|
||||
#FTP_PASSWORD="password"
|
||||
#FTP_PASSWORD='password'
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
|
@ -173,6 +174,13 @@ DEST="s3+http://foobar-backup-bucket/backup-folder/"
|
|||
#SWIFT_AUTHURL="foobar_swift_authurl"
|
||||
#SWIFT_AUTHVERSION="2"
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# DROPBOX INFORMATION
|
||||
# ------------------------------------------------------------------------------
|
||||
# Uncomment these lines if you're using Dropbox
|
||||
#
|
||||
#DPBX_ACCESS_TOKEN="foobar_dropbox_access_token"
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# INCLUDE LIST OF DIRECTORIES
|
||||
|
|
@ -182,15 +190,15 @@ DEST="s3+http://foobar-backup-bucket/backup-folder/"
|
|||
#
|
||||
# Here is an example with multiple locations:
|
||||
#
|
||||
#INCLIST=( "/home/*/Documents" \
|
||||
# "/home/*/Projects" \
|
||||
# "/home/*/logs" \
|
||||
# "/home/www/mysql-backups" \
|
||||
#INCLIST=( '/home/*/Documents' \
|
||||
# '/home/*/Projects' \
|
||||
# '/home/*/logs' \
|
||||
# '/home/www/mysql-backups' \
|
||||
# )
|
||||
#
|
||||
# Simpler example with one location:
|
||||
|
||||
INCLIST=( "/home/foobar_user_name/Documents/" )
|
||||
INCLIST=( '/home/foobar_user_name/Documents/' )
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
|
@ -202,15 +210,18 @@ INCLIST=( "/home/foobar_user_name/Documents/" )
|
|||
#
|
||||
# Here is an example with multiple locations:
|
||||
#
|
||||
#EXCLIST=( "/home/*/Trash" \
|
||||
# "/home/*/Projects/Completed" \
|
||||
# "/**.DS_Store" \
|
||||
# "/**Icon?" \
|
||||
# "/**.AppleDouble" \
|
||||
#EXCLIST=( '/home/*/Trash' \
|
||||
# '/home/*/Projects/Completed' \
|
||||
# '/**.DS_Store' \
|
||||
# '/**Icon?' \
|
||||
# '/**.AppleDouble' \
|
||||
# )
|
||||
#
|
||||
# If you don't want to exclude anything, use EXCLIST=()
|
||||
#
|
||||
# Simpler example with one location. Adapt it to your needs.
|
||||
|
||||
EXCLIST=( "/home/foobar_user_name/Documents/foobar-to-exclude" )
|
||||
EXCLIST=( '/home/foobar_user_name/Documents/foobar-to-exclude' )
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
|
@ -257,9 +268,9 @@ ENCRYPTION='yes'
|
|||
# (your backups will be encrypted with this password) or is used
|
||||
# for the "GPG_SIGN_KEY" (see below).
|
||||
# Comment out if you aren't using encryption
|
||||
# Note: if you have a '$' in your passphrase, escape it with a '\'
|
||||
# Note: if you have a ' in your passphrase, escape it accordingly.
|
||||
|
||||
PASSPHRASE="foobar_gpg_passphrase"
|
||||
PASSPHRASE='foobar_gpg_passphrase'
|
||||
|
||||
# Specify which GPG keys you would like to use (even if you have only one).
|
||||
# If you are running this from a cron, it is highly recommended to create separate
|
||||
|
|
@ -289,6 +300,14 @@ GPG_SIGN_KEY="foobar_gpg_key"
|
|||
#
|
||||
#SECRET_KEYRING="/home/foobar_user_name/.gnupg/duplicity.gpg
|
||||
|
||||
# Here you can specify options that will be passed to GPG.
|
||||
# If you can, avoid using quotes here, as it hasn't been tested much yet.
|
||||
# You shouldn't need to remove the following default (--no-show-photos)
|
||||
# For example an user reported (GitHub issue #145) that since gnupg v2.1,
|
||||
# the option "--pinentry-mode loopback" is necessary,
|
||||
# then set GPG_OPTIONS="--no-show-photos --pinentry-mode loopback"
|
||||
GPG_OPTIONS="--no-show-photos"
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# STATIC BACKUP OPTIONS
|
||||
|
|
@ -335,7 +354,7 @@ CLEAN_UP_VARIABLE="4"
|
|||
# (a full backup every 7 days), and you execute duplicity-backup once a day.
|
||||
# After six months you'll have 25 full backups, each with daily incrementals
|
||||
# in between. Perhaps you're keeping the backups past 1 month "just in case",
|
||||
# and so the older incrementals are overkill – weekly full backups beyond
|
||||
# and so the older incrementals are overkill - weekly full backups beyond
|
||||
# one month backward would suffice. In this case you can set
|
||||
# "REMOVE_INCREMENTALS_OLDER_THAN to, say, "4" which will delete the
|
||||
# incrementals for backup sets beyond the four most recent, keeping
|
||||
|
|
@ -408,7 +427,7 @@ MAIL="mailx" # default command for Linux mail
|
|||
# Third-party notification services. If NOTIFICATION_SERVICE is not provided, no
|
||||
# notifications will be sent.
|
||||
|
||||
# Possible values for NOTIFICATION_SERVICE are: slack, pushover
|
||||
# Possible values for NOTIFICATION_SERVICE are: slack, pushover, ifttt, telegram
|
||||
NOTIFICATION_SERVICE=""
|
||||
NOTIFICATION_FAILURE_ONLY="yes" # send notifications only if there was an error while creating backup
|
||||
|
||||
|
|
@ -422,6 +441,15 @@ SLACK_EMOJI="package"
|
|||
PUSHOVER_TOKEN="" # App token generated at pushover.net
|
||||
PUSHOVER_USER="" # User key from pushover.net
|
||||
|
||||
# Provider: IFTTT
|
||||
IFTTT_KEY="" # Key for MAKER channel at IFTTT
|
||||
IFTTT_MAKER_EVENT="duplicity" # name the event to trigger at IFTTT Maker Channel
|
||||
IFTTT_HOOK_URL="https://maker.ifttt.com/trigger/$IFTTT_MAKER_EVENT/with/key/$IFTTT_KEY" # ONLY change this if IFTTT changes it
|
||||
IFTTT_VALUE2="" # general purpose value to pass to your maker channel (optional)
|
||||
|
||||
# Provider: Telegram
|
||||
TELEGRAM_CHATID="" #Generate a Telegram bot following guide: https://core.telegram.org/bots#3-how-do-i-create-a-bot
|
||||
TELEGRAM_KEY=""
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# TROUBLESHOOTING
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue