alecandido / nixpkgs

0 stars 0 forks source link

Backup #24

Open alecandido opened 4 months ago

alecandido commented 4 months ago

Track my user and few orgs (i.e. qiboteam, qibogang, and nnpdf). Possibly even subset of some orgs (I don't care about having a backup of pineapplgrids or reportengine).

Schedule daily uploads. Keep shallow.

Periodically (monthly?) copy the full snapshot to a different location.

Code

Make a backup flake in alecandido/flakes (Python, there is JSON and TOML support built-in).

Keep the systemd unit in alecandido/nixpkgs?

Config file

Specify which repos (or sets) to download:

[scp]
villarose = ["~/path/to/folder1", "~/path/to/folder2", "..."]
yukon = ["~/path/to/folder3", "~/path/to/folder4", "..."]
"..." = ["..."]

[http]
group1 = ["..."]

[git.github]
owners = ["alecandido", "qiboteam", "qibogang"]
repos = ["nnpdf/eko", "nnpdf/yadism", "nnpdf/pineappl", "..."]

[git.gitlab]
"..." = ["..."]

Keep different sources separate, because of addressing (but also because they may have different APIs).

GitHub

gh api /user/repos --jq '.[] | {"name": .name, "owner": .owner.login, "url": .ssh_url}' --paginate