Add backup for the Hugo blog

This commit is contained in:
Muaz Ahmad 2024-12-17 14:24:48 +05:00
parent 8734e3d48b
commit a9f5b9c013

View file

@ -14,6 +14,11 @@ mkdir "$FORGEJO_ROOT"
su forgejo -c "forgejo dump -f /tmp/forgejo.tar --type tar"
cp /tmp/forgejo.tar "$FORGEJO_ROOT"
# Hugo
HUGO_ROOT="$BACKUP_ROOT/Hugo"
mkdir "$HUGO_ROOT"
cp /opt/hugo-blog "$HUGO_ROOT" -r
# Compress and send
tar -cavf "./$BACKUP_ROOT.tar.zst" "./$BACKUP_ROOT" && rm -r "$BACKUP_ROOT"
scp "./$BACKUP_ROOT.tar.zst" public@Mehen:~/