Skip to content

Instantly share code, notes, and snippets.

@ranedk
Created July 9, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ranedk/abf40cf0346a2a699428 to your computer and use it in GitHub Desktop.
Save ranedk/abf40cf0346a2a699428 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import datetime
import glob
for i in range(10, 0, -1):
yy, mm, dd = (datetime.datetime.now() - datetime.timedelta(days=i)).strftime("%Y-%m-%d").split("-")
directory='/volume1/Ameyo_Backup/Converted_Voicelogs/localhost/%s-%s-%s' % (yy, mm, dd)
campaigns = glob.glob('%s/*' % directory)
for camp in campaigns:
print ">>", yy,mm,dd,camp
bin = "/volume1/Ameyo_Backup/Converted_Voicelogs/s3cmd/s3cmd sync --skip-existing"
frm = camp
to = "s3://cfoxrecording/%s/%s/%s" % (yy, mm, dd)
command = "%s %s %s" % (bin, frm, to)
print command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment