~dricottone/secret-utils

secret-utils/backup -rwxr-xr-x 759 bytes
9585733cDominic Ricottone Initial commit 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh

if [ $# -eq 0 ]; then
  /usr/bin/printf "USAGE: backup COMMAND\n"
  exit 1
fi

while [[ $# -gt 0 ]]; do
  case "$1" in
  -h|--help|help)
    /usr/bin/printf "backup COMMAND\n"
    /usr/bin/printf "Commands:\n"
    /usr/bin/printf "  help   show help text\n"
    /usr/bin/printf "  files  backup local files\n"
    /usr/bin/printf "  legal  backup a legal documents directory\n"
    /usr/bin/printf "  music  backup a music media directory\n"
    exit 0
    ;;

  files)
    shift
    exec /usr/local/bin/backup-files $@
    ;;

  legal)
    shift
    exec /usr/local/bin/backup-legal $@
    ;;

  music)
    shift
    exec /usr/local/bin/backup-music $@
    ;;

  *)
    /usr/bin/printf "Unknown command '%s'\n" "$1"
    exit 1
    ;;
  esac
done