1
0
Fork 0
mirror of https://github.com/clockfort/GitHub-Backup.git synced 2025-03-09 00:00:03 +01:00

Update github-backup.py

This commit is contained in:
Anthony Gargiulo 2013-07-23 16:02:48 -04:00
parent cea9fc9c4b
commit 609c20468f

View file

@ -42,14 +42,14 @@ def process_repo(repo, args):
git_args = ""
if not args.cron:
print("Processing repo: %s"%(repo.full_name))
print("Processing repo: {0}".format(repo.full_name))
if os.access('%s/%s/.git'%(args.backupdir,repo.name),os.F_OK):
if os.access('{0}/{1}/.git'.format(args.backupdir,repo.name),os.F_OK):
if not args.cron:
print("Repo already exists, let's try to update it instead")
os.system('cd %s/%s;git pull %s'%(args.backupdir, repo.name, git_args))
os.system('cd {0}/{1};git pull {2}'.format(args.backupdir, repo.name, git_args))
else: # Repo doesn't exist, let's clone it
os.system('git clone %s %s %s/%s'%(git_args, repo.git_url, args.backupdir, repo.name))
os.system('git clone {0} {1} {2}/{3}'.format(git_args, repo.git_url, args.backupdir, repo.name))
if __name__ == "__main__":
main()