Created
July 9, 2015 13:55
-
-
Save ranedk/abf40cf0346a2a699428 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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