| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | # this script should be used when 'no history = yes' in hdup's configuration |
| 4 | # What it does: it copies the static archives to a save place. |
| 5 | # It takes three arguments: |
| 6 | # 1. the current archive name |
| 7 | # 2. the directory to which #1 should be copied |
| 8 | # 3. the current scheme |
| 9 | |
| 10 | # This script can serve as a basis. Feel free to extend it. |
| 11 | # (c) Miek Gieben, distributed under GPL v2 |
| 12 | # It currently does not: check if encryption is used - there not |
| 13 | # copying the archive |
| 14 | # It also does not take chunk size into account |
| 15 | |
| 16 | ar=$1 |
| 17 | to=$2 |
| 18 | scheme=$3 |
| 19 | |
| 20 | if [scip-shell system . . `[`. $scheme == "restore" -o $scheme == "remote" ]; then |
| 21 | echoscip-shell system . . echo. "Wrong scheme" |
| 22 | exit 1; |
| 23 | fi; |
| 24 | |
| 25 | if [scip-shell system . . `[`. ! -f $ar ]; then |
| 26 | echoscip-shell system . . echo. "Cannot find archive" |
| 27 | exit 1; |
| 28 | fi |
| 29 | |
| 30 | if [scip-shell system . . `[`. -f $to ]; then |
| 31 | echoscip-shell system . . echo. "Destination directory is a file" |
| 32 | exit 1; |
| 33 | fi |
| 34 | |
| 35 | if [scip-shell system . . `[`. ! -e $to ]; then |
| 36 | mkdirscip-shell system . . mkdir. -p $to |
| 37 | fi |
| 38 | |
| 39 | # copy it |
| 40 | cpscip-shell system . . cp. -f $ar $to |