12

Loci is a python script that can backup a directory to a server using rsync - It keeps track of the backups that have been done. Multiple backups may be kept. Rsync is used to handle the backups so only the needfull is copied and single files can be recovered from the backup if needed. loci -b tag : Backup under the tag given (I used days of the week)

loci -l : List backups showing those tags unused, backups that are needed, and backups that been run more than 5 times. I refresh these.

loci -r tag : Refresh a tag's backup - delete the files under that tag and backuplog entries to prepare for a fresh backup using loci -b

~/.backuplog a file in .csv format that keeps track of backups done.

~/.config/loci/settings Settings file. Fully commented.

you are viewing a single comment's thread
view the rest of the comments
[-] waspentalive@lemmy.one 4 points 3 weeks ago

It's also to help me learn python. And it works for me. : ^ )

[-] ChapulinColorado@lemmy.world 1 points 3 weeks ago

Bash does seem like a better fit for this kind of script since it is a lot more portable.

I.e.: It comes by default for many Linux distributions. For windows, a Git bash install will get you most utilities needed for large reliable scripts (grep, scp, find, sort, uniq, cat, tr, ls, etc.).

With that said, you should write it on whatever language you want, especially if it is for learning purposes, that’s where the fun comes from :)

[-] newthrowaway20@lemmy.world 0 points 3 weeks ago* (last edited 3 weeks ago)

Don't mind him. Any time someone shares code, there's always someone else who did nothing talking about how much better your code could have been. Just noise from the peanut gallery.

[-] waspentalive@lemmy.one 2 points 3 weeks ago

Yeah, no problem... I started out with just bare rsync - but I did the backup infrequently and needed my notes to know the command. Then I wrote a simple shell script to run the rsync for me. Then I decided I needed more than one backup, redundancy is good. Then I wanted to keep track of the backups so I had it write to .backuplog then that file started getting dated (every time I run a "sun" backup the record of the previous one is useless) so Finally TaDa! loci is born.

this post was submitted on 29 Mar 2025
12 points (100.0% liked)

Selfhosted

46091 readers
191 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.

Resources:

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

Questions? DM the mods!

founded 2 years ago
MODERATORS