Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduled backups stopped working when configured as root. #1683

Open
gwstorm opened this issue Apr 11, 2024 · 2 comments
Open

Scheduled backups stopped working when configured as root. #1683

gwstorm opened this issue Apr 11, 2024 · 2 comments

Comments

@gwstorm
Copy link

gwstorm commented Apr 11, 2024

output of the console command backintime --diagnostics

{
"backintime": {
"name": "Back In Time",
"version": "1.4.4-dev.d33f35e1",
"running-as-root": false,
"latest-config-version": 6,
"local-config-file": "/root/.config/backintime/config",
"local-config-file-found": false,
"global-config-file": "/etc/backintime/config",
"global-config-file-found": false,
"started-from": "/usr/share/backintime/common",
"user-callback": "/root/.config/backintime/user-callback",
"keyring-supported": false
},
"host-setup": {
"OS": {
"/etc/os-release": "Arch Linux",
"/etc/arch-release": "",
"/etc/lsb-release": "DISTRIB_ID="Arch"\nDISTRIB_RELEASE="rolling"\nDISTRIB_DESCRIPTION="Arch Linux"\n"
},
"platform": "Linux-6.8.4-zen1-1-zen-x86_64-with-glibc2.39",
"system": "Linux #1 ZEN SMP PREEMPT_DYNAMIC Fri, 05 Apr 2024 00:14:08 +0000",
"display-system": "($XDG_SESSION_TYPE not set)",
"locale": "en_US, UTF-8",
"PATH": "/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl",
"RSYNC_OLD_ARGS": "(not set)",
"RSYNC_PROTECT_ARGS": "(not set)"
},
"python-setup": {
"python": "3.11.8 main Feb 12 2024 14:50:05 CPython GCC 13.2.1 20230801",
"python-executable": "/usr/bin/python3",
"python-executable-symlink": true,
"python-executable-resolved": "/usr/bin/python3.11",
"sys.path": [
"/usr/share/backintime/qt/plugins",
"/usr/share/backintime/common/plugins",
"/usr/share/backintime/plugins",
"/usr/share/backintime/common",
"/usr/lib/python311.zip",
"/usr/lib/python3.11",
"/usr/lib/python3.11/lib-dynload",
"/usr/lib/python3.11/site-packages"
],
"qt": {
"Version": "PyQt 6.6.1 / Qt 6.6.3"
}
},
"external-programs": {
"rsync": {
"version": "3.2.7",
"protocol": "31.0",
"capabilities": {
"file_bits": 64,
"inum_bits": 64,
"timestamp_bits": 64,
"long_int_bits": 64,
"socketpairs": true,
"symlinks": true,
"symtimes": true,
"hardlinks": true,
"hardlink_specials": true,
"hardlink_symlinks": true,
"IPv6": true,
"atimes": true,
"batchfiles": true,
"inplace": true,
"append": true,
"ACLs": true,
"xattrs": true,
"secluded_args": "optional",
"iconv": true,
"prealloc": true,
"stop_at": true,
"crtimes": false
},
"optimizations": {
"SIMD_roll": true,
"asm_roll": false,
"openssl_crypto": true,
"asm_MD5": false
},
"checksum_list": [
"xxh128",
"xxh3",
"xxh64",
"md5",
"md4",
"sha1",
"none"
],
"compress_list": [
"zstd",
"lz4",
"zlibx",
"zlib",
"none"
],
"daemon_auth_list": [
"sha512",
"sha256",
"sha1",
"md5",
"md4"
]
},
"ssh": "OpenSSH_9.7p1, OpenSSL 3.2.1 30 Jan 2024",
"sshfs": "(no sshfs)",
"encfs": "(no encfs)",
"shell": "/usr/bin/bash",
"shell-version": "GNU bash, version 5.2.26(1)-release (x86_64-pc-linux-gnu)"
}
}

Version: backintime-git from the AUR built in clean chroot

Scheduled backups have stopped working when configuring BiT as root. I've read that it's not the recommended method, but the polkit option doesn't work with Wayland and there are some critical files that I like to back up from various directories like /etc and /var that a regular user can't touch. I've tried the every 5 minutes, anacron and custom hours (the latter being what I've always used) and the result is always the same -

journal output after scheduled backup attempt.
Apr 11 08:35:00 europa crond[55536]: pam_unix(crond:session): session opened for user root(uid=0) by root(uid=0)
Apr 11 08:35:00 europa CROND[55539]: (root) CMD (/usr/bin/nice -n19 /usr/bin/ionice -c2 -n7 /usr/bin/backintime --debug backup-job)
Apr 11 08:35:00 europa backintime[55543]: DEBUG: [common/backintime.py:608 argParse] Used argument(s): {'debug': True, 'quiet': False, 'command': 'backup-job', 'checksum': False, 'func': <function backupJob at 0x769a279e53a0>}
Apr 11 08:35:00 europa CROND[55536]: (root) CMDOUT (DEBUG: [common/backintime.py:608 argParse] Used argument(s): {'debug': True, 'quiet': False, 'command': 'backup-job', 'checksum': False, 'func': <function backupJob at 0x769a279e53a0>})
Apr 11 08:35:00 europa backintime[55543]: DEBUG: [common/backintime.py:609 argParse] Unknown argument(s): []
Apr 11 08:35:00 europa CROND[55536]: (root) CMDOUT (DEBUG: [common/backintime.py:609 argParse] Unknown argument(s): [])
Apr 11 08:35:00 europa backintime[55543]: DEBUG: [common/backintime.py:511 startApp] {'name': 'Back In Time', 'version': '1.4.4-dev.d33f35e1', 'running-as-root': False} ['Arch Linux', 'DISTRIB_ID="Arch"\nDISTRIB_RELEASE="rolling"\nDISTRIB_DESCRIPTION="Arch Linux"\n', '\n']
Apr 11 08:35:00 europa CROND[55536]: (root) CMDOUT (DEBUG: [common/backintime.py:511 startApp] {'name': 'Back In Time', 'version': '1.4.4-dev.d33f35e1', 'running-as-root': False} ['Arch Linux', 'DISTRIB_ID="Arch"\nDISTRIB_RELEASE="rolling"\nDISTRIB_DESCRIPTION="Arch Linux"\n', '\n'])
Apr 11 08:35:00 europa CROND[55536]: (root) CMDOUT (DEBUG: [common/tools.py:2663 BackupJobDaemon.daemonize] first fork pid: 55544)
Apr 11 08:35:00 europa backintime[55543]: DEBUG: [common/tools.py:2663 BackupJobDaemon.daemonize] first fork pid: 55544
Apr 11 08:35:00 europa CROND[55536]: (root) CMDOUT (DEBUG: [common/tools.py:2663 BackupJobDaemon.daemonize] first fork pid: 0)
Apr 11 08:35:00 europa backintime[55544]: DEBUG: [common/tools.py:2663 BackupJobDaemon.daemonize] first fork pid: 0
Apr 11 08:35:00 europa CROND[55536]: (root) CMDOUT (DEBUG: [common/tools.py:2672 BackupJobDaemon.daemonize] decouple from parent environment)
Apr 11 08:35:00 europa backintime[55544]: DEBUG: [common/tools.py:2672 BackupJobDaemon.daemonize] decouple from parent environment
Apr 11 08:35:00 europa CROND[55536]: (root) CMDOUT (DEBUG: [common/tools.py:2680 BackupJobDaemon.daemonize] second fork pid: 55545)
Apr 11 08:35:00 europa backintime[55544]: DEBUG: [common/tools.py:2680 BackupJobDaemon.daemonize] second fork pid: 55545
Apr 11 08:35:00 europa CROND[55536]: (root) CMDOUT (DEBUG: [common/tools.py:2680 BackupJobDaemon.daemonize] second fork pid: 0)
Apr 11 08:35:00 europa backintime[55545]: DEBUG: [common/tools.py:2680 BackupJobDaemon.daemonize] second fork pid: 0
Apr 11 08:35:00 europa CROND[55536]: (root) CMDOUT (DEBUG: [common/tools.py:2689 BackupJobDaemon.daemonize] redirect standard file descriptors)
Apr 11 08:35:00 europa backintime[55545]: DEBUG: [common/tools.py:2689 BackupJobDaemon.daemonize] redirect standard file descriptors
Apr 11 08:35:00 europa backintime[55545]: Main profile(1) :: DEBUG: [common/configfile.py:591 Config.setCurrentProfile] Change current profile: 1=Main profile
Apr 11 08:35:00 europa backintime[55545]: Main profile(1) :: DEBUG: [common/tools.py:227 initiate_translation] No language code. Use systems current locale.
Apr 11 08:35:00 europa backintime[55545]: Main profile(1) :: DEBUG: [common/backintime.py:691 getConfig] config file: /root/.config/backintime/config
Apr 11 08:35:00 europa backintime[55545]: Main profile(1) :: DEBUG: [common/backintime.py:692 getConfig] share path: /root/.local/share/backintime
Apr 11 08:35:00 europa backintime[55545]: Main profile(1) :: DEBUG: [common/backintime.py:693 getConfig] profiles: 1=Main profile
Apr 11 08:35:00 europa backintime[55545]: Main profile(1) :: ERROR: [common/backintime.py:705 getConfig] Back In Time is not configured!
Apr 11 08:35:00 europa CROND[55536]: (root) CMDOUT ()
Apr 11 08:35:00 europa CROND[55536]: (root) CMDOUT (Back In Time)
Apr 11 08:35:00 europa CROND[55536]: (root) CMDOUT (Version: 1.4.4-dev.d33f35e1)
Apr 11 08:35:00 europa CROND[55536]: (root) CMDOUT ()
Apr 11 08:35:00 europa CROND[55536]: (root) CMDOUT (Back In Time comes with ABSOLUTELY NO WARRANTY.)
Apr 11 08:35:00 europa CROND[55536]: (root) CMDOUT (This is free software, and you are welcome to redistribute it)
Apr 11 08:35:00 europa CROND[55536]: (root) CMDOUT (under certain conditions; type `backintime --license' for details.)
Apr 11 08:35:00 europa CROND[55536]: (root) CMDOUT ()
Apr 11 08:35:00 europa CROND[55536]: (root) CMDEND (/usr/bin/nice -n19 /usr/bin/ionice -c2 -n7 /usr/bin/backintime --debug backup-job)
Apr 11 08:35:00 europa CROND[55536]: pam_unix(crond:session): session closed for user root

I have tried creating alternate profiles and verified that rsync itself initiated by cron does work as I have a single rsync command running daily for another backup.

Running BiT via sudo -E backintime-qt allows for manual snapshots under the same profile that failed when executed from the cronjob.

Here's the cron as it is created by BiT -

#Back In Time system entry, this will be edited by the gui:
0 8,12,18 * * * /usr/bin/nice -n19 /usr/bin/ionice -c2 -n7 /usr/bin/backintime --debug backup-job
@buhtz
Copy link
Member

buhtz commented Apr 12, 2024

Thanks for reporting. Not sure what is going on. But your output indicates that BIT can not find a config.

ERROR: [common/backintime.py:705 getConfig]  Back In Time is not configured!

@gwstorm
Copy link
Author

gwstorm commented Apr 12, 2024

It appears there's a disconnect between the UI and the config files. Running as root requires a config file in /root/.config/backintime, which wasn't created when I restored the config from the backup drive. The directories at /root/.config/backintime and /root/.local/share/backintime were created though. I copied the config from $HOME/.config/backintime/ to the root path and the backup ran. However, all changes made to the config from the UI are reflected in the $HOME/.config/backintime and not the root path, so any changes made don't get picked up for backups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants