backup.sh 689 Bytes
Newer Older
1
2
#!/bin/sh

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
COMPLETE=0
DIR=

if [ $# -ge 1 -a "$1" = "-h" ]; then
    echo "$0: [-c] [path]

-c:   Backup everything
path: Where to save the file" >&2
    exit 1
fi

if [ $# -ge 1 -a "$1" = "-c" ]; then
    COMPLETE=1
    shift
fi

if [ $# -ge 1 ]; then
20
    DIR="$1/"
21
22
fi

23
now=$(date +"%Y_%m_%d") 
24
if [ $COMPLETE -eq 1 ]; then
25
        filename="${DIR}backup_"$now
26
27
        zip -r $filename web2py/applications/vidjil/uploads/ web2py/applications/vidjil/databases/
else
28
        filename="${DIR}backup_essentials_"$now
29
30
31
32
        zip -r $filename web2py/applications/vidjil/databases/ web2py/applications/vidjil/uploads/data_file* web2py/applications/vidjil/uploads/fused_file*
fi

echo $filename