]> arthur.barton.de Git - backup-script.git/log
backup-script.git
8 years agoWrite more information to "stamp file"
Alexander Barton [Tue, 24 Nov 2015 13:17:52 +0000 (14:17 +0100)]
Write more information to "stamp file"

8 years agoUpdate trial run message, don't call it "synchronization command"
Alexander Barton [Tue, 24 Nov 2015 12:21:53 +0000 (13:21 +0100)]
Update trial run message, don't call it "synchronization command"

8 years agobackup-status: Enhance status message
Alexander Barton [Tue, 24 Nov 2015 12:03:58 +0000 (13:03 +0100)]
backup-status: Enhance status message

8 years agoImplement "scp" backup type
Alexander Barton [Wed, 18 Nov 2015 16:12:20 +0000 (17:12 +0100)]
Implement "scp" backup type

This backup type is handy to save router configuration files, for
example. The defaults are suitable for Cisco IOS devices.

8 years agoFirst step to support multiple "backup types"
Alexander Barton [Wed, 18 Nov 2015 15:27:34 +0000 (16:27 +0100)]
First step to support multiple "backup types"

8 years agoFix more warnings of shellcheck(1), use "[[ ... ]]" instead of "[ ... ]"
Alexander Barton [Wed, 18 Nov 2015 15:26:09 +0000 (16:26 +0100)]
Fix more warnings of shellcheck(1), use "[[ ... ]]" instead of "[ ... ]"

8 years agoFix two warnings of shellcheck(1)
Alexander Barton [Wed, 18 Nov 2015 15:24:45 +0000 (16:24 +0100)]
Fix two warnings of shellcheck(1)

8 years agobackup-status: Implement "--errors" to only list backups with errors
Alexander Barton [Mon, 5 Oct 2015 08:41:42 +0000 (10:41 +0200)]
backup-status: Implement "--errors" to only list backups with errors

8 years agobackup-status: Reformat usage information
Alexander Barton [Mon, 5 Oct 2015 08:40:58 +0000 (10:40 +0200)]
backup-status: Reformat usage information

8 years agoUpdate usage information, add [-|--latest]
Alexander Barton [Mon, 5 Oct 2015 08:19:40 +0000 (10:19 +0200)]
Update usage information, add [-|--latest]

8 years agoUse relative symlinks for ZFS snapshots
Alexander Barton [Thu, 1 Oct 2015 12:43:47 +0000 (14:43 +0200)]
Use relative symlinks for ZFS snapshots

This eases renaming of systems etc.

8 years agorsync: Use better progress output when available (protocol version >=31)
Alexander Barton [Thu, 1 Oct 2015 12:37:40 +0000 (14:37 +0200)]
rsync: Use better progress output when available (protocol version >=31)

8 years agoDetect rsync and its protocol version
Alexander Barton [Thu, 1 Oct 2015 12:27:39 +0000 (14:27 +0200)]
Detect rsync and its protocol version

8 years agoDefault system excludes: Only exclude content, not directory itself
Alexander Barton [Mon, 21 Sep 2015 12:09:04 +0000 (14:09 +0200)]
Default system excludes: Only exclude content, not directory itself

8 years agoRefactor list of default excludes for system backups
Alexander Barton [Mon, 21 Sep 2015 11:57:35 +0000 (13:57 +0200)]
Refactor list of default excludes for system backups

8 years agoAdd "[default_]exclude_dirs_add" options
Alexander Barton [Mon, 21 Sep 2015 11:48:50 +0000 (13:48 +0200)]
Add "[default_]exclude_dirs_add" options

8 years agobackup-status: Backup directory uses configuration file name
Alexander Barton [Mon, 21 Sep 2015 10:27:12 +0000 (12:27 +0200)]
backup-status: Backup directory uses configuration file name

8 years agobackup-status: Don't read ${conf_d}/backup-script.conf twice
Alexander Barton [Mon, 21 Sep 2015 10:26:40 +0000 (12:26 +0200)]
backup-status: Don't read ${conf_d}/backup-script.conf twice

8 years agobackup-status: Use /var/backups as default backup target
Alexander Barton [Mon, 24 Aug 2015 08:39:15 +0000 (10:39 +0200)]
backup-status: Use /var/backups as default backup target

This has been implemented in commit 1af443845d1f for "backup-script",
so implement it for "backup-status", too!

8 years agoFilesystem summary: Use "zfs list" on ZFS filesystems
Alexander Barton [Mon, 24 Aug 2015 08:24:41 +0000 (10:24 +0200)]
Filesystem summary: Use "zfs list" on ZFS filesystems

8 years agoRead in configuration before showing usage information
Alexander Barton [Thu, 20 Aug 2015 14:55:05 +0000 (16:55 +0200)]
Read in configuration before showing usage information

And show more configuration details on regular runs, too.

8 years agobackup-script-wrapper: Check for PID file ("lock file")
Alexander Barton [Wed, 19 Aug 2015 08:19:59 +0000 (10:19 +0200)]
backup-script-wrapper: Check for PID file ("lock file")

Check for the existence of the PID and abort if if exists file before
redirecting the output to the log file, to not garble it when an other
instance is still running.

8 years agobackup-script-wrapper: Sort variables alphabetically
Alexander Barton [Wed, 19 Aug 2015 08:18:18 +0000 (10:18 +0200)]
backup-script-wrapper: Sort variables alphabetically

8 years agobackup-status: Implement new "--latest" option
Alexander Barton [Wed, 19 Aug 2015 08:13:29 +0000 (10:13 +0200)]
backup-status: Implement new "--latest" option

8 years agobackup-status: Refactor argument parsing
Alexander Barton [Wed, 19 Aug 2015 08:06:33 +0000 (10:06 +0200)]
backup-status: Refactor argument parsing

8 years agobackup-status: Correctly show "current" snapshot as newest
Alexander Barton [Wed, 19 Aug 2015 07:59:25 +0000 (09:59 +0200)]
backup-status: Correctly show "current" snapshot as newest

8 years agobackup-status: Use "poster -ap" when "--running" finds a running job
Alexander Barton [Tue, 18 Aug 2015 14:27:23 +0000 (16:27 +0200)]
backup-status: Use "poster -ap" when "--running" finds a running job

8 years agobackup-status: Implement "--running" option
Alexander Barton [Tue, 18 Aug 2015 14:22:26 +0000 (16:22 +0200)]
backup-status: Implement "--running" option

This option checks if a backup is running at the moment (exit code 0)
or not (exit code 1).

8 years agobackup-status: Remove unused variables
Alexander Barton [Tue, 18 Aug 2015 14:02:13 +0000 (16:02 +0200)]
backup-status: Remove unused variables

"local" and "destdir" seem to be unused?

8 years agobackup-status: Correctly quote and initialize variables
Alexander Barton [Tue, 18 Aug 2015 14:01:48 +0000 (16:01 +0200)]
backup-status: Correctly quote and initialize variables

8 years agobackup-status: Use exit code 2 when displaying usage information
Alexander Barton [Tue, 18 Aug 2015 10:24:16 +0000 (12:24 +0200)]
backup-status: Use exit code 2 when displaying usage information

8 years agobackup-status: Use same configuration search order than backup-script
Alexander Barton [Tue, 18 Aug 2015 10:23:50 +0000 (12:23 +0200)]
backup-status: Use same configuration search order than backup-script

8 years agobackup-script-wrapper: Show non-zero exit code in mail subject
Alexander Barton [Tue, 18 Aug 2015 09:22:05 +0000 (11:22 +0200)]
backup-script-wrapper: Show non-zero exit code in mail subject

8 years agobackup-script-wrapper: Use FQDN for mail subject
Alexander Barton [Tue, 18 Aug 2015 09:21:16 +0000 (11:21 +0200)]
backup-script-wrapper: Use FQDN for mail subject

8 years agobackup-script-wrapper: Write a "delimiter line" to the log file
Alexander Barton [Tue, 18 Aug 2015 09:14:25 +0000 (11:14 +0200)]
backup-script-wrapper: Write a "delimiter line" to the log file

8 years agoREADME.md: Update "configuration" section
Alexander Barton [Tue, 18 Aug 2015 09:09:00 +0000 (11:09 +0200)]
README.md: Update "configuration" section

8 years agoExit with code 7 when not all jobs have been run
Alexander Barton [Tue, 18 Aug 2015 09:08:38 +0000 (11:08 +0200)]
Exit with code 7 when not all jobs have been run

8 years agoStreamline and document exit codes
Alexander Barton [Tue, 18 Aug 2015 09:08:03 +0000 (11:08 +0200)]
Streamline and document exit codes

8 years agoReturn exit code 1 on errors!
Alexander Barton [Tue, 18 Aug 2015 08:48:03 +0000 (10:48 +0200)]
Return exit code 1 on errors!

8 years agobackup-script-wrapper: Return exit code of backup-script
Alexander Barton [Tue, 18 Aug 2015 08:46:21 +0000 (10:46 +0200)]
backup-script-wrapper: Return exit code of backup-script

8 years agobackup-script-wrapper: Use bash
Alexander Barton [Tue, 18 Aug 2015 08:46:04 +0000 (10:46 +0200)]
backup-script-wrapper: Use bash

backup-script itself already uses /bin/bash, so we don't loose portability.
And now we can use nice bash features in the future ;-)

8 years agoDisable compression for the local system
Alexander Barton [Tue, 18 Aug 2015 08:41:37 +0000 (10:41 +0200)]
Disable compression for the local system

8 years agoUse /usr/local/etc/backup-script.conf by default (not /etc/...)
Alexander Barton [Tue, 18 Aug 2015 08:35:59 +0000 (10:35 +0200)]
Use /usr/local/etc/backup-script.conf by default (not /etc/...)

8 years agoUse /var/backups as default backup target
Alexander Barton [Tue, 18 Aug 2015 08:32:49 +0000 (10:32 +0200)]
Use /var/backups as default backup target

8 years agoTest for conf_d in /usr/local/etc/backup-script.d, too
Alexander Barton [Tue, 18 Aug 2015 08:32:23 +0000 (10:32 +0200)]
Test for conf_d in /usr/local/etc/backup-script.d, too

8 years agoDisplay location of configuration when usage is shown
Alexander Barton [Tue, 18 Aug 2015 08:31:55 +0000 (10:31 +0200)]
Display location of configuration when usage is shown

8 years agoLook for configuration file in /usr/local/etc/, too
Alexander Barton [Tue, 18 Aug 2015 08:31:02 +0000 (10:31 +0200)]
Look for configuration file in /usr/local/etc/, too

8 years agobackup-script-wrapper: Append log messages to an logfile
Alexander Barton [Tue, 18 Aug 2015 08:17:00 +0000 (10:17 +0200)]
backup-script-wrapper: Append log messages to an logfile

8 years agobackup-script-wrapper: Use "exec" to redirect output
Alexander Barton [Tue, 18 Aug 2015 07:58:13 +0000 (09:58 +0200)]
backup-script-wrapper: Use "exec" to redirect output

8 years agobackup-script-wrapper: Better detect default mail recipient
Alexander Barton [Tue, 18 Aug 2015 07:49:35 +0000 (09:49 +0200)]
backup-script-wrapper: Better detect default mail recipient

Use "logcheck" if an user exists by this name, or if an alias is defined
in /etc/aliases. Use "root" otherwise.

8 years agobackup-script-wrapper: Correctly quote external command call
Alexander Barton [Tue, 18 Aug 2015 07:41:58 +0000 (09:41 +0200)]
backup-script-wrapper: Correctly quote external command call

8 years agobackup-script-wrapper: Update copyright notice for 2015 :-)
Alexander Barton [Tue, 18 Aug 2015 07:41:31 +0000 (09:41 +0200)]
backup-script-wrapper: Update copyright notice for 2015 :-)

8 years agoMake sure that "target" does NOT end with a slash ("/")
Alexander Barton [Tue, 11 Aug 2015 12:59:14 +0000 (14:59 +0200)]
Make sure that "target" does NOT end with a slash ("/")

8 years agoMake sure that "source" does end with a slash ("/")
Alexander Barton [Tue, 11 Aug 2015 12:59:02 +0000 (14:59 +0200)]
Make sure that "source" does end with a slash ("/")

8 years agoZFS: Use correct date for snapshot names
Alexander Barton [Tue, 4 Aug 2015 12:10:30 +0000 (14:10 +0200)]
ZFS: Use correct date for snapshot names

Don't use the current time, but the time of the (last) backup.

8 years agoFix "new snapshot" log messages in "trial run" mode
Alexander Barton [Tue, 4 Aug 2015 09:37:58 +0000 (11:37 +0200)]
Fix "new snapshot" log messages in "trial run" mode

8 years agoMove Makefile.ax into new lib/ directory
Alexander Barton [Mon, 3 Aug 2015 14:25:40 +0000 (16:25 +0200)]
Move Makefile.ax into new lib/ directory

8 years agoCreate individual Makefile's for all subdirectories
Alexander Barton [Mon, 3 Aug 2015 14:23:56 +0000 (16:23 +0200)]
Create individual Makefile's for all subdirectories

8 years agoetc/backup-script.conf: add "default_target"
Alexander Barton [Wed, 29 Jul 2015 20:28:16 +0000 (22:28 +0200)]
etc/backup-script.conf: add "default_target"

8 years agoUpdate README.md, including spelling fixes
Alexander Barton [Wed, 29 Jul 2015 19:37:13 +0000 (21:37 +0200)]
Update README.md, including spelling fixes

8 years agoDelay script exit for 3 seconds on abort
Alexander Barton [Wed, 29 Jul 2015 10:57:20 +0000 (12:57 +0200)]
Delay script exit for 3 seconds on abort

This allows things (like the rsync server process) to settle a
little bit ...

8 years agobackup-status: Fix handling of "current" snapshot on ZFS
Alexander Barton [Wed, 29 Jul 2015 10:56:16 +0000 (12:56 +0200)]
backup-status: Fix handling of "current" snapshot on ZFS

8 years agobackup-status: Correctly get size of directories pointed to by symlinks
Alexander Barton [Wed, 29 Jul 2015 10:38:29 +0000 (12:38 +0200)]
backup-status: Correctly get size of directories pointed to by symlinks

8 years agoAdd support for generations on ZFS
Alexander Barton [Wed, 29 Jul 2015 10:31:58 +0000 (12:31 +0200)]
Add support for generations on ZFS

8 years agoFix filesystem detection in DeleteSubvolume()
Alexander Barton [Wed, 29 Jul 2015 10:15:54 +0000 (12:15 +0200)]
Fix filesystem detection in DeleteSubvolume()

8 years agoCreate the system directory as subvolume when using generations
Alexander Barton [Wed, 29 Jul 2015 08:41:37 +0000 (10:41 +0200)]
Create the system directory as subvolume when using generations

This is required for ZFS in the future and shouldn't be a problem on btrfs.

8 years agoIntroduce Initialize_Last_SysTarget_Snapshot() function
Alexander Barton [Wed, 29 Jul 2015 08:39:24 +0000 (10:39 +0200)]
Introduce Initialize_Last_SysTarget_Snapshot() function

This is in preparation for ZFS support.

8 years agoAdd compatibility layer for backup-pull(1) config files
Alexander Barton [Wed, 29 Jul 2015 08:35:30 +0000 (10:35 +0200)]
Add compatibility layer for backup-pull(1) config files

The following (now deprecated!) configurations variables used by the
backup-pull(1) script in job definition files are automatically mapped to
the new backup-script variables:

- host -> system
- source -> source_root
- pre_exec -> job_pre_exec
- post_exec -> job_post_exec

8 years agoREADME: Add description for "[default_]source_root"
Alexander Barton [Wed, 29 Jul 2015 08:34:07 +0000 (10:34 +0200)]
README: Add description for "[default_]source_root"

8 years agoCloneSubvolume: Introduce $snapshot parameter
Alexander Barton [Wed, 29 Jul 2015 08:31:05 +0000 (10:31 +0200)]
CloneSubvolume: Introduce $snapshot parameter

This is in preparation for ZFS support.

8 years agoUse correct counter when checking which generations to delete
Alexander Barton [Wed, 29 Jul 2015 08:28:44 +0000 (10:28 +0200)]
Use correct counter when checking which generations to delete

In a18f7fb9 we fixed the counter, but up to now didn't use the
correct counter at all :-/

8 years agoDeclare function variables as "local"
Alexander Barton [Wed, 29 Jul 2015 08:27:14 +0000 (10:27 +0200)]
Declare function variables as "local"

8 years agoLittle whitespace fixes ;-)
Alexander Barton [Mon, 27 Jul 2015 16:50:11 +0000 (18:50 +0200)]
Little whitespace fixes ;-)

8 years agoCorrectly count the number of available generations
Alexander Barton [Mon, 27 Jul 2015 16:49:56 +0000 (18:49 +0200)]
Correctly count the number of available generations

Add 2 to the number of desired snapshots, because of the "latest" link
and the current snapshot.

8 years agoDon't add "--rsh=..." to rsync command line in "local" mode
Alexander Barton [Mon, 27 Jul 2015 16:48:25 +0000 (18:48 +0200)]
Don't add "--rsh=..." to rsync command line in "local" mode

8 years agoAdd support for new "[default_]source_root" variable
Alexander Barton [Mon, 27 Jul 2015 16:45:27 +0000 (18:45 +0200)]
Add support for new "[default_]source_root" variable

You can use this variable to define the "source root path".
Default is "/", which was the hardcoded value up to now.

8 years ago{Create|Clone|Rename|Delete}Subvolume: Prepare for multiple FS
Alexander Barton [Mon, 27 Jul 2015 16:43:35 +0000 (18:43 +0200)]
{Create|Clone|Rename|Delete}Subvolume: Prepare for multiple FS

Currently only btrfs is supported, but support for ZFS is planned.
Introduce GetFS() function to detect the file system type.

8 years agoCreateSubvolume(): Fix wrong positional parameter number
Alexander Barton [Mon, 27 Jul 2015 16:41:31 +0000 (18:41 +0200)]
CreateSubvolume(): Fix wrong positional parameter number

8 years agoFix some variable quoting
Alexander Barton [Mon, 27 Jul 2015 13:08:55 +0000 (15:08 +0200)]
Fix some variable quoting

This fixes some warnings of shellcheck(1).

8 years agoUse $() instead of ``
Alexander Barton [Mon, 27 Jul 2015 13:08:26 +0000 (15:08 +0200)]
Use $() instead of ``

This fixes some warnings of shellcheck(1).

8 years agoMove subvolume handling to individual functions
Alexander Barton [Mon, 27 Jul 2015 13:02:11 +0000 (15:02 +0200)]
Move subvolume handling to individual functions

This allows us to support different storage backends/filesystems
in the future.

8 years agoFix "backup-status" to respect "system" configuration variable
Alexander Barton [Tue, 2 Jun 2015 10:21:05 +0000 (12:21 +0200)]
Fix "backup-status" to respect "system" configuration variable

8 years agoREADME.md: Add introduction and copyright information
Alexander Barton [Tue, 2 Jun 2015 10:15:30 +0000 (12:15 +0200)]
README.md: Add introduction and copyright information

8 years agoAdd README.md file
Alexander Barton [Tue, 2 Jun 2015 10:11:21 +0000 (12:11 +0200)]
Add README.md file

8 years agoDon't detect "latest" symlink as latest backup generation
Alexander Barton [Tue, 12 May 2015 09:32:01 +0000 (11:32 +0200)]
Don't detect "latest" symlink as latest backup generation

Problem introduced by commit f31ea55373 ('Create "latest" link to
latest generation').

8 years agobackup-status: Correctly show sizes on non-Linux systems
Alexander Barton [Tue, 12 May 2015 08:46:58 +0000 (10:46 +0200)]
backup-status: Correctly show sizes on non-Linux systems

And ignore the current locale when calling "stat".
Tested with OS X/Darwin and Linux.

8 years agobackup-status: Fix wrong path in size calculation
Alexander Barton [Tue, 12 May 2015 08:34:10 +0000 (10:34 +0200)]
backup-status: Fix wrong path in size calculation

When no snapshots are being used, the wrong path name has been
passed to the Check_Size function.

8 years agobackup-status: Handle "conf_d" variable in backup-script.conf
Alexander Barton [Tue, 12 May 2015 08:33:09 +0000 (10:33 +0200)]
backup-status: Handle "conf_d" variable in backup-script.conf

9 years agoCreate "latest" link to latest generation
Alexander Barton [Thu, 16 Apr 2015 12:58:32 +0000 (14:58 +0200)]
Create "latest" link to latest generation

9 years agoIntroduce internal "sys_root" variable
Alexander Barton [Thu, 16 Apr 2015 12:58:04 +0000 (14:58 +0200)]
Introduce internal "sys_root" variable

9 years agoImplement "{default_}job_pre_exec" and "{default_}job_post_exec"
Alexander Barton [Thu, 26 Feb 2015 13:50:06 +0000 (14:50 +0100)]
Implement "{default_}job_pre_exec" and "{default_}job_post_exec"

When the pre-exec command returns non 0, the backup job will be
skipped and listed as failed (which results in the "there have been
errors" summy); if it returns 99, the backup job is skipped but NOT
accounted as failed.

The exit code of the post-exec command is ignored.

9 years agoFix error handling if target directory can't be created
Alexander Barton [Thu, 26 Feb 2015 13:42:37 +0000 (14:42 +0100)]
Fix error handling if target directory can't be created

9 years agoUpdate copyright notice
Alexander Barton [Thu, 26 Feb 2015 13:07:34 +0000 (14:07 +0100)]
Update copyright notice

9 years agoFix message "working on ..." for local system
Alexander Barton [Thu, 27 Nov 2014 12:14:23 +0000 (13:14 +0100)]
Fix message "working on ..." for local system

9 years agoDon't modify /etc directory on "make install"
Alexander Barton [Mon, 17 Nov 2014 16:59:37 +0000 (17:59 +0100)]
Don't modify /etc directory on "make install"

9 years agoUse "conf_d" variable to set configuration directory
Alexander Barton [Mon, 17 Nov 2014 16:57:45 +0000 (17:57 +0100)]
Use "conf_d" variable to set configuration directory

Now one can set "conf_d" to an arbitrary directory in /etc/backup-script.conf
(or its older location /etc/backup-script.d/backup-script.conf).

9 years agoRead /etc/backup-script.conf as configureation file, too
Alexander Barton [Mon, 17 Nov 2014 16:52:24 +0000 (17:52 +0100)]
Read /etc/backup-script.conf as configureation file, too

9 years agoAdd AUTHORS file
Alexander Barton [Mon, 17 Nov 2014 16:32:40 +0000 (17:32 +0100)]
Add AUTHORS file

9 years agoUse ax-make
Alexander Barton [Mon, 17 Nov 2014 16:31:56 +0000 (17:31 +0100)]
Use ax-make

9 years agobackup-status: Clarify warning message
Alexander Barton [Thu, 24 Jul 2014 09:19:15 +0000 (11:19 +0200)]
backup-status: Clarify warning message