<commit_before>import dropbox
import tarfile
import os
import time

#functions
def addContentToDropbox(compressedFile):
  client = dropbox.client.DropboxClient("asdf")
  print 'linked account: ', client.account_info()
  f = open(compressedFile, 'rb')
  response = client.put_file(compressedFile, f)
  print 'uploaded: ', response


#back up the content
dateOfBackup = time.strftime("%Y-%m-%d") 
compressedFile = "content" + dateOfBackup + ".tar.gz"
tar = tarfile.open(compressedFile, "w:gz")
tar.add("/home/bitnami/apps/wordpress/htdocs/wp-content/")
tar.close()
#add the content to dropbox
addContentToDropbox(compressedFile)
#clean up
os.remove(compressedFile)

#back up the database
sqlCommand = """mysqldump --add-drop-table > database.sql"""
os.system(sqlCommand)
compressedFile = "database" + dateOfBackup + ".tar.gz"
tar = tarfile.open(compressedFile, "w:gz")
tar.add("asdf" + ".sql")
tar.close()
#add the database to dropbox
addContentToDropbox(compressedFile)
#clean up
os.remove(compressedFile)
<commit_msg>making changes to suit cron functionality<commit_after>import dropbox
import tarfile
import os
import time

#functions
def addContentToDropbox(compressedFile):
  client = dropbox.client.DropboxClient("_GSRrTwYHmEAAAAAAAAABW3vaBdS5B9bYSkBgnO0MJsGFihL0GAa2Zao2icFQiuu")
  print 'linked account: ', client.account_info()
  f = open(compressedFile, 'rb')
  response = client.put_file(compressedFile, f)
  print 'uploaded: ', response

#get the date
dateOfBackup = time.strftime("%Y-%m-%d")
#back up the content
compressedFileC = "content" + dateOfBackup + ".tar.gz"
tar = tarfile.open(compressedFileC, "w:gz")
tar.add("/home/bitnami/apps/wordpress/htdocs/wp-content/")
tar.close()
#add the content to dropbox
addContentToDropbox(compressedFileC)
#clean up
os.remove(compressedFileC)

#back up the database
sqlCommand = """/opt/bitnami/mysql/bin/mysqldump --add-drop-table > database.sql"""
os.system(sqlCommand)
compressedFileD = "database" + dateOfBackup + ".tar.gz"
tar = tarfile.open(compressedFileD, "w:gz")
tar.add("database.sql")
tar.close()
#add the database to dropbox
addContentToDropbox(compressedFileD)
#clean up
os.remove(compressedFileD)

{'fraction_non_alphanumeric': 0.13170055452865065, 'fraction_numerical': 0.003234750462107209, 'mean_word_length': 6.26510067114094, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4116528', 'n_tokens_mistral': 762, 'n_tokens_neox': 760, 'n_words': 163}