mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-05 16:58:59 +00:00
17 lines
No EOL
468 B
Python
17 lines
No EOL
468 B
Python
import os
|
|
import sys
|
|
|
|
CURRENT_DIR = os.path.dirname(__file__)
|
|
NEWSBLUR_DIR = ''.join([CURRENT_DIR, '/../../'])
|
|
sys.path.insert(0, NEWSBLUR_DIR)
|
|
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
|
|
|
|
import time
|
|
import s3
|
|
from django.conf import settings
|
|
|
|
filename = 'backup_redis_%s.rdb.gz' % time.strftime('%Y-%m-%d-%H-%M')
|
|
path = '/var/lib/redis/dump.rdb'
|
|
print 'Uploading %s / %s to S3...' % (filename, path)
|
|
s3.save_file_in_s3(path, name=filename)
|
|
os.remove(filename) |