Selfhosted
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:
-
Be civil.
-
No spam.
-
Posts are to be related to self-hosting.
-
Don't duplicate the full text of your blog or readme if you're providing a link.
-
Submission headline should match the article title.
-
No trolling.
-
Promotion posts require active participation, with an account that is at least 30 days old. F/LOSS without a paywall has exceptions, with requirements. See the rules link for details. Tags [CBH] or [AIP] are required, see the links in Rule 8 for details.
-
AI-related discussions and AI-involved promotional posts have additional requirements for tagging, as noted in Rule 7 and the AI & Promotional Post Expanded Rules post, and find example disclosures here.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
view the rest of the comments
This line seems to list all dumps and then deletes all but the two most recent ones.
In detail:
ls -1 /backup/*.dumplists all files ending with .dump alphabetically inside the /backup directoryhead -n -2returns all filenames except the two most recent ones from the end of the listxargs rm -fpasses the filenames torm -fto delete themTake a look at explainshell.com.
I just looked up the man page, and actually
head -n -2means "everything up to but not including the last two lines", so this should always leave two files remaining.You're right, I edited my comment. Thanks!
Your xargs comment is still wrong tho. It deletes ALL but the most recent two files.
Fixed, thanks.