Safe location for custom scripts?

I searched the Wiki for that topic but didn’t find a fulfilling answer.

What is the recommended location in IPFire’s filesystem for custom scripts and stuff that shall not deleted/modified/changed by an update?
Is there a best-pratice solution where to put custom stuff?

1 Like

Not sure if it’s best practice or not but what I have done is the following.

I created a user called fcronuser and created a home directory for that user. It is a non-login user. I then have a scripts directory there which I use for any of the scripts I use, most of which I then run with frcon using the fcronuser user so the fcrontab entries are not lost when a core update that includes fcron is carried out.

I also use that fcronuser directory for a directory where any data that is created by my scripts is stored.

I then add that home directory to the backup list using include.user

That has worked well for me with all my custom settings with fcronuser being backed up.

One of the scripts I have does a weekly backup including the logs and clears out any backups older than 3 months and I then run bacula to backup those IPFire backups to my central backup system.

Hope that helps to suggest some options you could look at for your situation.

@bonnietwin Thanks for you reply.
But I think you misunderstood my question. It was not about being able to restore things by putting them into the backup, but rather to find a way that they are not touched by the update, so that there’s no need to restore anything.
Is there a folder that is not touched when one does a normal core update? Or can I just create some subfolder somewhere for that?

I did understand your question, I just extended my answer to also cover backups. Sorry for confusing things.

Simple answer. Best to create your own directory somewhere. Best place is under /home/ as that will not be wiped by any core update.


Additional input.

I would still recommend adding your files into the backup as when something goes badly wrong on your system and you need to do a fresh install, having all your scripts in the backup makes the recovery much simpler. Of course you can also just copy them across from some other machine that you have copied them to but that is more long winded.