mirror of
https://github.com/linuxserver/git-backup.git
synced 2026-02-20 04:15:07 +08:00
add page to clone command, get's all the repos, covered up until we reach 300+ repos
This commit is contained in:
parent
37a0f576f8
commit
a248fce966
@ -9,7 +9,7 @@ REPO_USER=""
|
||||
# delete folders older than 20 days
|
||||
for i in $(find /backup/ -maxdepth 1 -type d -mtime +20 -print); do echo -e "Deleting directory $i";rm -rf $i; done
|
||||
|
||||
# make today's folder
|
||||
# make today's folders
|
||||
if [ -d "${FOLDER_MAKE}" ]; then
|
||||
rm -rf "${FOLDER_MAKE}"
|
||||
fi
|
||||
@ -17,7 +17,9 @@ mkdir -p "${FOLDER_MAKE}" && touch "${FOLDER_MAKE}"
|
||||
|
||||
# clone git repositories into todays folder
|
||||
cd "${FOLDER_MAKE}"
|
||||
curl -s "https://api.github.com/users/${REPO_USER}/repos?per_page=200" | python -c $'import json, sys, os\nfor repo in json.load(sys.stdin): os.system("git clone " + repo["clone_url"])'
|
||||
curl -s "https://api.github.com/users/${REPO_USER}/repos?page=1&per_page=100" | python -c $'import json, sys, os\nfor repo in json.load(sys.stdin): os.system("git clone " + repo["clone_url"])'
|
||||
curl -s "https://api.github.com/users/${REPO_USER}/repos?page=2&per_page=100" | python -c $'import json, sys, os\nfor repo in json.load(sys.stdin): os.system("git clone " + repo["clone_url"])'
|
||||
curl -s "https://api.github.com/users/${REPO_USER}/repos?page=3&per_page=100" | python -c $'import json, sys, os\nfor repo in json.load(sys.stdin): os.system("git clone " + repo["clone_url"])'
|
||||
|
||||
# permissions
|
||||
chown -R abc:abc "${FOLDER_MAKE}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user