0

I'd like to make a daily backup from my machine to another. The backup is created via duply, manually triggering it works fine:

$ duply home status
Start duply v1.11.3, time is 2018-11-19 17:07:10.
Using profile '/home/ingo/.duply/home'.
Using installed duplicity version 0.7.11, python 2.7.13, gpg 2.1.18 (Home: /home/ingo/.gnupg), awk 'GNU Awk 4.1.4, API: 1.1 (GNU MPFR 3.1.5, GNU MP 6.1.2)', grep 'grep (GNU grep) 2.27', bash '4.4.12(1)-release (x86_64-pc-linux-gnu)'.
Autoset found secret key of first GPG_KEY entry 'XXXXXXXXXXXX' for signing.
Checking TEMP_DIR '/tmp' is a folder and writable (OK)
Test - Encrypt to 'XXXXXXXXXXXXX' & Sign with 'XXXXXXXXXXXXXX' (OK)
Test - Decrypt (OK)
Test - Compare (OK)
Cleanup - Delete '/tmp/duply.32286.1542643630_*'(OK)

(...)

Import of duplicity.backends.webdavbackend Succeeded
ssh: Connected (version 2.0, client OpenSSH_7.2p2)
ssh: Authentication (publickey) successful!
ssh: [chan 0] Opened sftp connection (server version 3)

(...)

--- Finished state OK at 17:07:40.743 - Runtime 00:00:29.722 ---

Yet when I put that very same command in crontab, it results in an error:

(...)
Import of duplicity.backends.webdavbackend Succeeded
ssh: Connected (version 2.0, client OpenSSH_7.2p2)
Using temporary directory /tmp/duplicity-_dXl2a-tempdir
Backend error detail: Traceback (most recent call last):
  File "/usr/bin/duplicity", line 1553, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 1547, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 1382, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 1126, in ProcessCommandLine
     backup, local_pathname = set_backend(args[0], args[1])
   File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 1015, in set_backend
     globals.backend = backend.get_backend(bend)
   File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 223, in get_backend
     obj = get_backend_object(url_string)
   File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 209, in get_backend_object
     return factory(pu)
   File "/usr/lib/python2.7/dist-packages/duplicity/backends/ssh_paramiko_backend.py", line 235, in __init__
     self.config['port'], e))
BackendException: ssh connection to planetmaker@archivius.XXXXXXX:5214 failed: Private key file is encrypted

BackendException: ssh connection to planetmaker@archivius.XXXXXXX:5214 failed: Private key file is encrypted
 01:05:06.287 Task 'INCR' failed with exit code '23'.
--- Finished state FAILED 'code 23' at 01:05:06.287 - Runtime 00:00:02.953 ---

Well, sure enough, so I created and installed an ssh - key which has password on the remote machine - and removed the other keys, so that there is only that one chance to login to archivius (and I double-checked as of this answer and the 2nd one there, too). But that didn't seem to have any effect on this problem. What am I missing, what do I overlook?

From my personal crontab:

crontab -l
5 1 *    * 1-5,7 /usr/bin/duply home incr
  • The cron initiated process is missing the appropriate environment variables to connect to the gpg and ssh agents.... Something like this – RubberStamp Nov 19 '18 at 16:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.