From a681b52517e9308010fd433e4352c24bc6d86778 Mon Sep 17 00:00:00 2001 From: Von Random Date: Fri, 20 Feb 2015 21:42:10 +0300 Subject: rename the config for it to be coherent with the script itself, add the license text and some comment fixes --- backup.cfg | 54 ------------------------------------------------------ backup.zsh | 24 ++++++++++++++++++++++++ backup.zsh.cfg | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 54 deletions(-) delete mode 100644 backup.cfg create mode 100644 backup.zsh.cfg diff --git a/backup.cfg b/backup.cfg deleted file mode 100644 index c852c98..0000000 --- a/backup.cfg +++ /dev/null @@ -1,54 +0,0 @@ -#### general options #### -## The protocol we want to use to store our backups. -## Can be ftp, sftp, ftps, ssh or local. -protocol='ssh' - -## The directory store backups in, locally or remotely. -backup_dir='relative_or_full_path' - -## The list of patterns to exclude from backups, for -## more details look into tar -X option. -#exclude_list='/usr/local/etc/backup/excludes.list' - -## The compression algorithm for backups. -## Can be gz, bz2, xz or empty (for non-compressed). -compress_format='xz' - -## An array with the set of directories within it. -## Optionally snapshot file can be added to store -## incremental diffs (tar -g option used). -## You'll have to deal with snapshots on your own: -## backup.zsh only handles backups (i.e. you can remove -## snapshot via cron on regular basis to ensure that -## full backups are created from time to time.) -source_dirs=( '/home/user/source1:/var/backup/snapshot.list' - '/etc' '/var/spool/mail:/var/backup/spool_snapshot.list' ) - -## Use with caution, the file existance is not checked -## on execution. -## Since this config is sourced, I advise adding some -## logic for that, or you can handle filename collisions -## externally. -#backup_filename='somebackup' - -## GPG key to encrypt backups, uses name of the private -## key in your keyring -#gnupg_key='keyname' - -#### remote options #### -## Remote host. -remote_host='hostname.tld' - -## Remote user. -remote_user='username' - -## Password, due to how openssh handles security it only -## works for *ftp* protocols; backups via ssh protocol -## work interactively. Later versions will have support -## for ssh keys. -remote_pass='PassWd' - -## Port is optional, the defaults are hardcoded. -#remote_port='443' - -# vim: ft=zsh diff --git a/backup.zsh b/backup.zsh index 99c9a63..6b13d12 100755 --- a/backup.zsh +++ b/backup.zsh @@ -1,4 +1,28 @@ #!/usr/bin/env zsh +# +# The MIT License (MIT) +# +# Copyright (c) 2014 Von Random +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + self_name=$0 # some hardcoded defaults diff --git a/backup.zsh.cfg b/backup.zsh.cfg new file mode 100644 index 0000000..b773677 --- /dev/null +++ b/backup.zsh.cfg @@ -0,0 +1,56 @@ +#### general options #### +## The protocol we want to use to store our backups. +## Can be ftp, sftp, ftps, ssh or local. +protocol='ssh' + +## The directory to store backups in, locally or remotely. +backup_dir='relative_or_full_path' + +## The list of patterns to exclude from backups, for +## more details look into tar -X option. +#exclude_list='/usr/local/etc/backup/excludes.list' + +## The compression algorithm for backups. +## Can be gz, bz2, xz or empty (for non-compressed). +compress_format='xz' + +## An array with the set of directories within it. +## Optionally snapshot file can be added to store +## incremental diffs (tar -g option used). +## You'll have to deal with snapshots on your own: +## backup.zsh only handles backups (i.e. you can remove +## snapshot via cron on regular basis to ensure that +## full backups are created from time to time.) +source_dirs=( '/home/user/source1:/var/backup/snapshot.list' + '/etc' '/var/spool/mail:/var/backup/spool_snapshot.list' ) + +## Use with caution, the file existance is not checked +## on execution. +## Since this config is sourced, I advise adding some +## logic for that, or you can handle filename collisions +## externally. +#backup_filename='somebackup' + +## GPG key to encrypt backups, uses name of the private +## key in your keyring. It is also entirely possible to +## add the GNUPGHOME environment variable export here in +## order to use the private key from a specific location. +#gnupg_key='keyname' + +#### remote options #### +## Remote host. +remote_host='hostname.tld' + +## Remote user. +remote_user='username' + +## Password, due to how openssh handles security it only +## works for *ftp* protocols; backups via ssh protocol +## work interactively. Later versions will have support +## for ssh keys... If I ever decide to make it happen. +remote_pass='PassWd' + +## Port is optional, the defaults are hardcoded. +#remote_port='443' + +# vim: ft=zsh -- cgit v1.2.3