bestia.dev This is a copy of the Codeberg readme, only because of SEO. Find the original on https://codeberg.org/bestia-dev-ready-for-use/codeberg_backup_scripts

codeberg_backup_scripts

Scripts to backup Codeberg repositories
version: 1.0.0 date: 2026-03-05 author: bestia.dev repository: codeberg.org

maintained ready_for_use

License codeberg_backup_scripts

Hashtags: #rustlang #tutorial
My projects on Codeberg are more like a tutorial than a finished product: bestia-dev tutorials.

Motivation

Codeberg can deny me access to my repositories at any moment without any warning. It can happen any day to anybody for any reason without explanation or recurse. Very concerning!

Sure I don't want to have all my eggs in one basket. I need to make a backup of all my repositories. I should automate this. It is just bash scripts.

Codeberg backup folders

My Codeberg backup folders are in my box_original_1 folder:
d:\box_original_1\BestiaDev\codeberg_backup_bestia_Dev\

This way they got synchronized to my online Hetzner Storage box automatically.
To be sure, I also make a backup of the box_original_1 folder to my 2 external disks regularly.

WSL bash scripts

2026-04-14
Codeberg limits SSH connection 50 for 5 minutes.
I have over 120 repos and this limit is affecting me when I want to fetch all my repos for backup.
Even when the repo has not changed at all, there goes one new connection for that.
SSH can create a persistent master multiplexed connection and then every SSH command can use that instead of creating every time a new connection.
Sadly, this does not work in cygwin, git-bash, MSYS in windows, but it works inside WSL.
I tried with multiple connections for speed, but codeberg has limits also for that. Now it is just simple call to git commans and the speed is now acceptable.

By default from WSL I cannot see the windows drives. That was my choice. But for this to work I need to mount a folder.

# in WSL Debian
sudo mkdir /mnt/codeberg_backup_bestia_dev
sudo mount -t drvfs d:\\box_original_1\\BestiaDev\\codeberg_backup_bestia_dev /mnt/codeberg_backup_bestia_dev
git config --global --add safe.directory '*'

https://ldpreload.com/blog/ssh-control
https://en.wikibooks.org/wiki/OpenSSH/Cookbook/Multiplexing

My ~/.ssh/config in WSL now has:

Host codeberg.org
   HostName codeberg.org
   User git
   IdentityFile ~/.ssh/codeberg_org_bestia_dev_git_ssh_1
   IdentitiesOnly yes
   ControlMaster auto
   ControlPath /home/luciano/.ssh/master-socket/git@codeberg.org:22
   ControlPersist 10m

And I had to create manually the folder:

mkdir /home/luciano/.ssh/master-socket

In this repository, there are copies of these scripts in folders just like I have them in my box_original_1 folder.

Open-source and free as a beer

My open-source projects are free as a beer (MIT license).
I just love programming.
But I need also to drink. If you find my projects and tutorials helpful, please buy me a beer by donating to my PayPal.
You know the price of a beer in your local bar ;-)
So I can drink a free beer for your health :-)
Na zdravje! Alla salute! Prost! Nazdravlje! 🍻

//bestia.dev
//codeberg.org/bestia-dev
//bestiadev.substack.com
//youtube.com/@bestia-dev-tutorials