Score:0

How to run déjà-dup backup tool as root in Ubuntu 20.04 LTS?

us flag

A common annoying daily problem with déjà pup: I try to backup many files which I (my user) have no reading access. I get this daily because I want to backup the whole /home directory:

enter image description here

Previous answers for this question are deprecated because the command gksu deja-dup-preferences does not work, since gksu is deprecated after Ubuntu 18.04. Furthermore I tried also sudo deja-dup-preferences but I get sudo: deja-dup-preferences: command not found.

I also tried sudo deja-dup --backup but I get

Traceback (innermost last):
  File "/usr/bin/duplicity", line 106, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 92, in with_tempdir
    fn()
  File "/usr/lib/python3/dist-packages/duplicity/dup_main.py", line 1525, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib/python3/dist-packages/duplicity/commandline.py", line 1175, in ProcessCommandLine
    globals.backend = backend.get_backend(args[0])
  File "/usr/lib/python3/dist-packages/duplicity/backend.py", line 225, in get_backend
    obj = get_backend_object(url_string)
  File "/usr/lib/python3/dist-packages/duplicity/backend.py", line 211, in get_backend_object
    return factory(pu)
  File "/usr/lib/python3/dist-packages/duplicity/backends/giobackend.py", line 82, in __init__
    ensure_dbus()
  File "/usr/lib/python3/dist-packages/duplicity/backends/giobackend.py", line 37, in ensure_dbus
    output = p.communicate()[0].decode("utf8", errors="replace")
 AttributeError: 'str' object has no attribute 'decode'

Therefore my question is: How to run déjà-dup backup tool as root in Ubuntu 20.04 LTS?

Score:2
cn flag

Don't run the déjà-dup backup tool as root. Do not run any graphical application as root. There is a good chance that that will break your system.

Use déjà-dup for what it is designed for: backup up what is most important: your personal user data. Once you loose these, they are lost forever. The files under /usr/lib, on the other hand, are available any minute in the form of numerous linux distributions.

Worry about backing up your system only after your backup strategy for your personal data is fully into place. Even then, most user, except server administrators, should probably not worry at all about backing up a system. If you do, then use the tools and methods dedicated for that job, e.g. timeshift for making regular snapshots of the system files.

Start investigating why files in your home directory, like .bashhistory, do not make it to the backup. Permission issues in your home folder, or in the directory where the backup is made? This kind of problems can result from running graphical applications as root with sudo.

us flag
Fully agreed, but I have important data in `/etc` (some configurations) and I want to backup also personal data in `/home` of the other users. Yes, I can use other strategies like crontab and rsync, I was wondering though if déjà-dup does the job.
us flag
And btw, the user `eva` is my daughter :) I want to backup her personal data also
vanadium avatar
cn flag
My answer to your question is "do not use Deja Dup" as root, so if this answered your current question, then please accept this answer. This is really a tool for personal backups only. For backing up files of user eva, you could make yourself member of the group eva. Then you can access these files.
us flag
done it ;) you did answer my question, thanks
I sit in a Tesla and translated this thread with Ai:

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.