Skip to content

Instantly share code, notes, and snippets.

@numb95
Last active April 16, 2017 09:18
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 numb95/e136e77870c23374c66f21b5513c990c to your computer and use it in GitHub Desktop.
Save numb95/e136e77870c23374c66f21b5513c990c to your computer and use it in GitHub Desktop.
import requests
import json
import os
url = "https://gitlab.com/api/v4/groups/GROUPNAME/projects?per_page=100"
headers = {
'private-token': "TOKEN_GET_FROM_GITLAB"
}
response = requests.request("GET", url, headers=headers)
parsed_json = json.loads(response.text)
for i in parsed_json:
os.system("mkdir /root/backup/" + i["name"])
os.system("git clone " + i["ssh_url_to_repo"] + " /root/backup/" + i["name"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment