this post was submitted on 17 Jan 2026
71 points (98.6% liked)

Selfhosted

54761 readers
349 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

  7. No low-effort posts. This is subjective and will largely be determined by the community member reports.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

hi peeps.

Im early on my selfhosting journey and managed to setup some things as a test in docker. the main service im looking to run is ERPNext. after a while I got it up and running so now I want to back this up including all the customization I did in the app.

where to start with this? any intuitive guide?

you are viewing a single comment's thread
view the rest of the comments
[–] irmadlad@lemmy.world 2 points 4 days ago (1 children)

In addition to daily backups, once a month I image the drive. I wrote a simple script triggered by a cron job to image the drive to a NAS backup. The daily backups go to 3 different offsite storage facilities, and two go to separate NAS drives. All drive images are kept both local and off premise as well. So, for individual files, etc, I can restore them from the daily backups. If the wheels fall off, I can restore the whole drive from an image. Might be a bit over engineered but I've been caught a few times and so I just decided that won't happen again.

[–] Cyber@feddit.uk 2 points 3 days ago (1 children)

Interesting.

Yep, I agree there's 2 types of backups:

  • data
  • OS image

Out of curiosity, how are you doing the drive imaging?

[–] irmadlad@lemmy.world 1 points 3 days ago* (last edited 3 days ago) (1 children)

Out of curiosity, how are you doing the drive imaging?

I wrote a script that is fired by a cron job once a month:

sudo nano /usr/local/bin/backup_drive.sh

spoiler

# Directory to store backups

BACKUP_DIR="/mnt/myhdd"

# Drive to backup

DRIVE="/dev/sdX"

# Create a timestamp

TIMESTAMP=$(date +"%Y%m%d")

# Filename for the new image

NEW_IMAGE="$BACKUP_DIR/my_drive_image_$TIMESTAMP.img"

# Create the image

sudo dd if=$DRIVE of=$NEW_IMAGE bs=4M status=progress

# Keep the last 3 images

ls -tp $BACKUP_DIR/my_drive_image_*.img | grep -v '/$' | tail -n +4 | xargs -I {} rm -- {}

Make the script executable:

sudo chmod +x /usr/local/bin/backup_drive.sh

Create Cron:

sudo crontab -e

0 3 1 * * /usr/local/bin/backup_drive.sh

Verify cron:

sudo crontab -l

I'm sure it could be written differently or that there is a better way to do the imaging, but that is the extent of my notes, and it works for me. As with any code you find on the internet, it is wise to evaluate before dropping on a production server.

[–] Cyber@feddit.uk 2 points 2 days ago (1 children)

Ah, good old dd

When you have some spare time, take a look at partclone - clonezilla uses it because it only backs up used blocks, not free space, so more efficient.

[–] irmadlad@lemmy.world 1 points 2 days ago

Thanks for the tip. I'll definitely check it out