Score:0

Configure Back In Time to backup home folders regardless of who is logged in

ar flag

Our home computer has two user accounts on it, one admin (user A) and one standard user (user B). I'm trying to use Back In Time to create regular, separate backups of each user's home folders (with permissions intact) regardless of who is currently logged in.

IE, if the computer is on, then I want backintime to check for and back up any changes to every user's home folders.

EXAMPLES: IF user A is logged in and user B is logged out for an entire day, I still want Back In Time to run a daily check/backup (if anything has changed) of user B's home folder, and vice-versa: even if User A is logged out all day, I still want Back In Time to run a daily check/backup of that user's home folder.

(How) is it possible to achieve this result while retaining permissions/ownership of the files and directories?

My rationale: Even though a user's home folder doesn't technically change unless or until that user actually logs in, I want to regularly check for and back up any changes regardless of whether the account is currently active because the user may have made changes and logged out before a new backup can complete.

What I've already tried: I set up two backup profiles from User A's (administrative) account, one for User A and one for User B, but they both went to User A's crontab, which I believe is only active when that User's account is active, correct? So if User B is logged in, backups won't run. Further, User B's backup is now owned by User A.

Option? Or would I set up backup profiles under each user's individual account that point toward the same backup locations? So if User A is logged in, a job to back up User B still occurs at least once, and if User B is logged in, a job to back up User A still occurs at least once. But I would be concerned it could create problems with ownership and permissions.

Option Example

User A backup profiles:

  1. User A backup runs hourly to /backup/location/UserA/
  2. User B backup runs on bootup/restart to /backup/location/UserB/.

User B backup profiles:

  1. User B backup runs hourly to /backup/location/UserB/
  2. User A backup runs on bootup/restart to /backup/location/UserA/.

Is the answer to making this work in configuring ACLs? That seems to be something my searches on this topic are pointing me toward...

Or setting up crontabs as different users? https://vnexplorer.net/set-up-automatic-mode-in-linux-with-crontab-s383585.html

Similarly, it is possible to schedule jobs in cron with the role of another user, using the -u flag :

sudo crontab -u username -e

heynnema avatar
ru flag
Just thinking out loud... run the root version of BIT, setup two profiles, one for User A and one for User B. Only backup the Documents folder for each user, schedule each to run at a selected interval. Hourly is too frequent. Worse case problem might be file ownerships of the backups, but that's easily fixable with one chown command after a restore.
ethan avatar
ar flag
Ok, so are you saying the only issue with running BIT as root is permissions, and not any potential security issues?
heynnema avatar
ru flag
Not permissions, but file ownerships. No guarantees that it'll work, but it's worth a try. If it works, I'll write a formal answer. Report back.
ethan avatar
ar flag
Thanks, I think I'm going to cut my losses on BIT and just switch back to Deja Dup. I can't for the life of me get the anacron scheduling function of BIT to work correctly and it was just making a mess of the backup process...the program is supposed to set a cron job to check whether it needs to do a backup every 15 minutes against the last backup's timestamp, but something goes wrong and it just does a new backup.
heynnema avatar
ru flag
I'm not sure I'd trust DD. You gave up pretty quickly on BIT, no?
ethan avatar
ar flag
Why wouldn't you trust DD? it has performed reliably for me for several years. My complaint with it is the lack of configurability and the lack of a transparent backup. But I haven't found a better option yet.
heynnema avatar
ru flag
I've heard nothing but trouble when users try to restore stuff that's been backed up with DD.
ethan avatar
ar flag
"Gave up quickly, no?" that assumes you know how long I've been trying to make BIT work...this is a production computer, I need to get on with my life with reliable software. BIT is not behaving as reliable software. DD has behaved as reliable software, and they partially solved the transparency issue with the new restore browser. It works for me, BIT doesn't.
heynnema avatar
ru flag
Use what works for you.
ethan avatar
ar flag
Yup, was hoping it would be BIT, but the issue with misbehaving scheduler causing 15min backups really soured me on it. I will try/explore again next upgrade... (probably 2025)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.