aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorÓscar Nájera <hi@oscarnajera.com>2021-05-30 18:49:05 +0200
committerÓscar Nájera <hi@oscarnajera.com>2021-05-30 18:51:12 +0200
commitafda402f4a745f5da826737bca731a45fd09c78c (patch)
tree26be8f02d57d2ec1275b7590afdfd8c9ef55e937
parent3a2c373825036b28722aea9118f06e54618a489d (diff)
downloaddotfiles-afda402f4a745f5da826737bca731a45fd09c78c.tar.gz
dotfiles-afda402f4a745f5da826737bca731a45fd09c78c.tar.bz2
dotfiles-afda402f4a745f5da826737bca731a45fd09c78c.zip
apply shell format to backup script
-rwxr-xr-xbin/backup.sh62
1 files changed, 31 insertions, 31 deletions
diff --git a/bin/backup.sh b/bin/backup.sh
index 1701844..356fa77 100755
--- a/bin/backup.sh
+++ b/bin/backup.sh
@@ -1,39 +1,39 @@
#! /bin/bash
-backup_local(){
- # external program to supply the passphrase:
- export BORG_PASSCOMMAND="pass show $1" # repo pass first arg
+backup_local() {
+ # external program to supply the passphrase:
+ export BORG_PASSCOMMAND="pass show $1" # repo pass first arg
- # Create Local Backups
- echo $( date ) "Creating Local Backups ..."
- REPOSITORY=$2 # repo vault path second arg
- shift 2 # consume the first 2 arguments
- borg create --list --filter AME --stats --compression=lz4 \
- --progress \
- --exclude '*.pyc' \
- --exclude '*/.mypy_cache/' \
- --exclude '*/venv/' \
- --exclude '*/.tox/' \
- --exclude '*/node_modules' \
- --exclude '*/js/compiled' \
- --exclude '*/target' \
- --exclude '*/dist-newstyle' \
- --exclude '*/.notmuch' \
- --exclude '*/mpd/log' \
- --exclude '*/elpa' \
- --exclude '*.elc' \
- --exclude '*/.local/straight' \
- $REPOSITORY::'{hostname}-{user}-{utcnow:%Y-%m-%dT%H:%M:%S}' \
- $@ # all the dirs to bac
+ # Create Local Backups
+ echo $(date) "Creating Local Backups ..."
+ REPOSITORY=$2 # repo vault path second arg
+ shift 2 # consume the first 2 arguments
+ borg create --list --filter AME --stats --compression=lz4 \
+ --progress \
+ --exclude '*.pyc' \
+ --exclude '*/.mypy_cache/' \
+ --exclude '*/venv/' \
+ --exclude '*/.tox/' \
+ --exclude '*/node_modules' \
+ --exclude '*/js/compiled' \
+ --exclude '*/target' \
+ --exclude '*/dist-newstyle' \
+ --exclude '*/.notmuch' \
+ --exclude '*/mpd/log' \
+ --exclude '*/elpa' \
+ --exclude '*.elc' \
+ --exclude '*/.local/straight' \
+ $REPOSITORY::'{hostname}-{user}-{utcnow:%Y-%m-%dT%H:%M:%S}' \
+ $@ # all the dirs to bac
- # Prune Local Backups
- echo $( date ) "Pruning local repository ..."
+ # Prune Local Backups
+ echo $(date) "Pruning local repository ..."
- borg prune --verbose --stats --list \
- --prefix='{hostname}-{user}-' \
- --keep-daily 7 \
- --keep-weekly 4 \
- --keep-monthly 6 $REPOSITORY
+ borg prune --verbose --stats --list \
+ --prefix='{hostname}-{user}-' \
+ --keep-daily 7 \
+ --keep-weekly 4 \
+ --keep-monthly 6 $REPOSITORY
}
backup_local borgbackup ssh://backup/media/Backup/daily_backup/ ~/dev/ ~/.mail/ ~/Nextcloud/ ~/org/ ~/src_car/ /media/backup/personal/Pictures/ /media/backup/personal/Libros/ /media/backup/personal/dev/ /media/backup/Archives/