-
Notifications
You must be signed in to change notification settings - Fork 0
/
s3databackup.sh
executable file
·38 lines (24 loc) · 1016 Bytes
/
s3databackup.sh
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
#!/bin/bash
a="carmatec.com"
b="carmatec.ae"
c="codewebber.com"
d="colorcuboid.com"
e="instacarma.com"
f="qatar.carmatec.com"
g="railscarma.com"
tar czf /backup/daily/${a}.tar.gz -C /home/carmatec/public_html/ carmatec.com
tar czf /backup/daily/${b}.tar.gz -C /home/carmatec/public_html/ carmatec.ae
tar czf /backup/daily/${c}.tar.gz -C /home/carmatec/public_html/ codewebber.com
tar czf /backup/daily/${d}.tar.gz -C /home/carmatec/public_html/ colorcuboid.com
tar czf /backup/daily/${e}.tar.gz -C /home/carmatec/public_html/ instacarma.com
tar czf /backup/daily/${f}.tar.gz -C /home/carmatec/public_html/ qatar.carmatec.com
tar czf /backup/daily/${g}.tar.gz -C /home/carmatec/public_html/ railscarma.com
##Directory which needs to be backed up
SOURCE="/backup/daily"
##Name of the backup in bucket
DESTINATION=`date +%F`
##Backup degree
DEGREE=2
##Uploading the daily backup to Amazon s3
/usr/bin/s3cmd -r put ${SOURCE} s3://carmatec-backup/${DESTINATION}/
find /backup/daily -mtime +1 -exec rm {} \;