mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Adding redis backup for new redis stroy server.
This commit is contained in:
parent
41bb982779
commit
c509177500
1 changed files with 16 additions and 0 deletions
16
utils/backups/backup_redis_story.py
Normal file
16
utils/backups/backup_redis_story.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
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_story_%s.rdb.gz' % time.strftime('%Y-%m-%d-%H-%M')
|
||||
path = '/var/lib/redis/dump.rdb'
|
||||
print 'Uploading %s (from %s) to S3...' % (filename, path)
|
||||
s3.save_file_in_s3(path, name=filename)
|
Loading…
Add table
Reference in a new issue