feat: git weekly backups

This commit is contained in:
Hane 2026-06-04 13:11:48 +02:00
commit 80dbae3b8a
2 changed files with 57 additions and 16 deletions

View file

@ -1,19 +1,45 @@
#+OPTIONS: toc:nil
* ROOT SERVICES
* INIT SYSTEM
** ROOT SERVICES (Currently none!)
=<service>.sh= to be symlinked to =/etc/init.d/podman-containers=
* USER SERVICES AND RUNLEVELS
** USER SERVICES AND RUNLEVELS
=.config= folder to be symlinked to =~=
* XDG VARIABLES AND RUNNING USER SERVICES ON LOGIN
** * XDG VARIABLES AND RUNNING USER SERVICES ON LOGIN
=.profile= to be symlinked to =/home/$USER/.profile=
* RUN USERS SERVICES ON BOOT
** RUN USERS SERVICES ON BOOT
Symlink =/etc/init.d/user= to =/etc/init.d/user.$usernames=. After add, add the latter service with =rc-update= as root.
* IF <USER> HAS PASSWORD
** IF <USER> HAS PASSWORD
Add the following to a new file in =/etc/doas.d/=:
#+begin_src shell
permit nopass <user> as <user>
permit nopass root as <user>
#+end_src
* Timed cron jobs
First, swap built-in =crond= for =dcron=. We need to swap cron binaries since we would have to give setgid capabilites to the whole Busybox binary to use the included cron binary, for which we also need to install =libcap=:
#+begin_src shell
# apk add dcron libcap
,** if crond is set up, remember to stop and delete it before continuing!
# rc-service dcron start
# rc-update add dcron
# setcap cap_setgid=ep /usr/sbin/crond
#+end_src
After this, remember to add =root= and =$USER= to the =cron= group!
We now set up =$USER='s crontab as such:
#+begin_src shell
#crontab -u $USER -e
@weekly ID=git-back.weekly /home/$user/pihanepi/orchestrating/cronjobs/forgejo-clone/forgejo-clone.sh
#+end_src
Finally, check =/var/log/messages= to confirm everything ran successfully.