mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
no need to pass filename into backup_psql.py in ansible postgres backup. removing it
This commit is contained in:
parent
a78dec3ed9
commit
0e81d2f346
2 changed files with 3 additions and 3 deletions
|
@ -62,4 +62,4 @@
|
|||
-v /backup/:/backup/
|
||||
--network=newsblurnet
|
||||
newsblur/newsblur_python3
|
||||
/srv/newsblur/utils/backups/backup_psql.py /backup/$BACKUP_FILE $BUCKET
|
||||
/srv/newsblur/utils/backups/backup_psql.py $BUCKET
|
|
@ -8,11 +8,11 @@ sys.path.insert(0, NEWSBLUR_DIR)
|
|||
|
||||
import boto3
|
||||
|
||||
filename = sys.argv[1]
|
||||
filename = os.listdir('/backup')[0]
|
||||
|
||||
print('Uploading %s to S3...' % filename)
|
||||
|
||||
s3 = boto3.resource('s3')
|
||||
bucket = sys.argv[2]
|
||||
bucket.upload_file(filename, name="postgres/%s" % filename.split("/")[1])
|
||||
bucket.upload_file(f'/backup/{filename}', name="postgres/%s" % filename)
|
||||
os.remove(filename)
|
||||
|
|
Loading…
Add table
Reference in a new issue