Skip to content

Commit 3a9e32e

Browse files
committed
Add gsutil sync script and the usage to readme
1 parent f0a7dab commit 3a9e32e

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,32 @@ $ sudo -i
3232
# cp backup.conf.sample backup.conf
3333
```
3434

35-
### Quick Settings
35+
### Quick Settings for Google Cloud Storage
3636

37-
#### backup.conf
37+
#### Install gsutil
3838

39-
* Buckets
39+
```
40+
# cd /backup
41+
# wget https://storage.googleapis.com/pub/gsutil.tar.gz
42+
# tar zxf gsutil.tar.gz
43+
```
44+
45+
#### Setup gsutil authentication
4046

41-
#### Sync
47+
```
48+
# /backup/gsutil/gsutil config -o /backup/serverbackup/boto.cfg
49+
```
50+
51+
#### backup.conf
52+
53+
Edit following entries.
4254

43-
Edit sync script.
55+
* Buckets
56+
* Sync
4457

4558
```
46-
gsutil $1 gs://$2/$3
59+
Buckets=backup-bucket
60+
Sync=/backup/serverbackup/sync.gsutil
4761
```
4862

4963
#### Backup commands

sync.gsutil

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
BOTO_PATH=/backup/serverbackup/boto.cfg
4+
5+
if [ "$DRY_RUN" ]; then
6+
/backup/gsutil/gsutil rsync -r $1 gs://$2/$3
7+
else
8+
/backup/gsutil/gsutil rsync -n -r $1 gs://$2/$3
9+
fi
10+
exit $?

0 commit comments

Comments
 (0)