Config folder backup to cloud

I backup some of my personal content with cloud sync tasks to Google Drive.

I would like to backup my config folder “/var/db/system/configs-” to the cloud too, but of course I cannot access the path from the cloud sync function. I guess I need a cron job to copy the config folder to my main pool and then I can cloud sync from there.

Can someone please help me creating a script that I can use in a cron job?

Thank you in advance

System backs up the config at 03h45 daily to /var/db/system/configs-<uuid> .

You should be able to pick it up there.

I know that already as I mentioned it in my post. What I’m looking for is some linux scripting help to copy that to a POOL which I can run a cloud sync from.

I guess there is a cp command in the script and I have a vague recollection you have to change the config of the file so it can be executable but it is a long time since I’ve done this.

you mean something like this?

DEST="/mnt/[**mypool**]"; [ -d "$DEST" ] && cp -r /var/db/system/configs-* "$DEST"/ && echo "OK" || echo "KO"

(you can also skip the [ -d "$DEST" ] && if you not interested to this check, also change the output && echo "OK" || echo "KO" as you pref).

I didn’t test it on cron but should work the same if running with root user

2 Likes

Is there any recommended procedure to follow on how to restore from this backup?

This was a recommendation before but it didn’t work for my specific problem as I didnt have a config folder. That is why I want to make a backup

thank you I’ll try this

Thank you that has worked as a CRON command and I now have the files backed up in my POOL and my Google Drive :+1:

I didn’t make a script I just pasted the command (with edits).

I couldn’t get it to work in shell as root (su) as it errored about permissions on the db files.

1 Like

I’m glad that this simple snipplet Is what you need for your use case, also because you put on my attention that there Is this backup option and i will start use It too :smile:
Perhaps i have to admit that, as @smione, i don’t have a clue to how eventually use It in case of needs.
You know also that the multi report send the complete config backup via email too? As i remember Joe has incapsulate that process into a function, so should be viable to extract and modify It to accomplish the Google drive sync

I didn’t know about the multi report which can send the config! I’ll have a look at that as well.

Sorry, brain fart!

1 Like

Could you please explain, how you plan to restore from this backup, if need arises?

It was referenced above but here is the link to another thread where someone suggests how it could be used. You may want to ask there how it can be used exactly. I will probably wait to ask that question if I ever need to.