grimoire

personal wiki
git clone git://git.pyratebeard.net/grimoire.git
Log | Files | Refs

tarsnap.md (409B)


      1 # tarsnap
      2 
      3 ## backup
      4 * `ratnaps`
      5 ```
      6 #!/bin/sh
      7 
      8 # Set up archive name
      9 computer=$(uname -n)
     10 now=$(date +%Y%m%d)
     11 name=${computer}-${now}
     12 #dirs="$@"
     13 
     14 # Create an archive
     15 /usr/bin/tarsnap -c \
     16     -f "${name}" \
     17     /etc /home /var /...
     18     #"${dirs}"
     19 ```
     20 * add to cron
     21 
     22 ## list
     23 ```
     24 tarsnap --list-archives | sort
     25 ```
     26 
     27 ## extract
     28 * extracts full path so genrally start from /
     29 ```
     30 tarsnap -x -f <archive_name>
     31 ```