mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

calendar-backup.sh (317B)


      1 #!/bin/bash
      2 
      3 set -e
      4 
      5 # run with chronic to avoid spam
      6 
      7 mkdir -p "$1"
      8 cd "$1" # required to have the right paths in the archive
      9 
     10 # avoid "file changed as we read it" errors from tar
     11 cp -R calendar_current calendar_backup
     12 FILE="dump-`date +%s`"
     13 tar cf ${FILE}.tar calendar_backup
     14 xz ${FILE}.tar
     15 rm -Rf calendar_backup
     16