Aggiungi 'glacier-backup'
Bash script for backing up data to Glacier with Duplicity and GPG encryption
This commit is contained in:
24
glacier-backup
Normal file
24
glacier-backup
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
source .rgs3-configrc
|
||||
|
||||
currently_backuping=$(ps -ef | grep duplicity | grep python | wc -l)
|
||||
|
||||
if [ $currently_backuping -eq 0 ]; then
|
||||
# Clear the recent log file
|
||||
cat /dev/null > ${LOGFILE_RECENT}
|
||||
|
||||
log ">>> removing old backups"
|
||||
duplicity remove-older-than ${KEEP_BACKUP_TIME} ${GS3_BUCKET} >> ${LOGFILE_RECENT} 2>&1
|
||||
|
||||
log ">>> creating and uploading backup to S3 Glacier storage"
|
||||
duplicity \
|
||||
incr --full-if-older-than ${FULL_BACKUP_TIME} \
|
||||
--asynchronous-upload \
|
||||
--archive-dir /dir/duplicity/cache/duplicity \
|
||||
--s3-use-glacier \
|
||||
--encrypt-key=${GPG_FINGERPRINT} \
|
||||
--sign-key=${GPG_FINGERPRINT} \
|
||||
${SOURCE} ${GS3_BUCKET} >> ${LOGFILE_RECENT} 2>&1
|
||||
|
||||
cat ${LOGFILE_RECENT} >> ${LOGFILE}
|
||||
fi
|
||||
Reference in New Issue
Block a user