ich habe ien komisches Problem mit Duplicity: Ich nutze es um Serverbackups auf ein google-drive speicher zu schieben. Das funktioniert wunderbar, wenn ich das Script direkt ausführe, wenn ich es aber per crontab ausführe bekomme ich die fehlermeldung dass accounts.google.com nicht erreichbar sei. Hä?!?!? Wie kann das sein? ich weis überhaupt nicht wo ich anfangen soll zu suchen!
Log wenn ich das Backupscript per crontab ausführe:
Code: Alles auswählen
###### Starting backup on Mon Dec 31 00:00:01 CET 2018 ######
APT List ...
Done
Dump Database ...
Creating backup for database mysql
Creating backup for database nextcloud
Creating backup for database vmail
Done
mainBackup....
Traceback (innermost last):
File "/usr/bin/duplicity", line 1560, in <module>
with_tempdir(main)
File "/usr/bin/duplicity", line 1546, in with_tempdir
fn()
File "/usr/bin/duplicity", line 1385, in main
action = commandline.ProcessCommandLine(sys.argv[1:])
File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 1135, in ProcessCommandLine
backup, local_pathname = set_backend(args[0], args[1])
File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 1010, 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/pydrivebackend.py", line 69, in __init__
gauth.CommandLineAuth()
File "/usr/local/lib/python2.7/dist-packages/pydrive/auth.py", line 120, in _decorated
self.Refresh()
File "/usr/local/lib/python2.7/dist-packages/pydrive/auth.py", line 475, in Refresh
self.credentials.refresh(self.http)
File "/usr/local/lib/python2.7/dist-packages/oauth2client/client.py", line 545, in refresh
self._refresh(http)
File "/usr/local/lib/python2.7/dist-packages/oauth2client/client.py", line 761, in _refresh
self._do_refresh_request(http)
File "/usr/local/lib/python2.7/dist-packages/oauth2client/client.py", line 780, in _do_refresh_request
body=body, headers=headers)
File "/usr/local/lib/python2.7/dist-packages/oauth2client/transport.py", line 282, in request
connection_type=connection_type)
File "/usr/local/lib/python2.7/dist-packages/httplib2/__init__.py", line 1694, in request
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/usr/local/lib/python2.7/dist-packages/httplib2/__init__.py", line 1434, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "/usr/local/lib/python2.7/dist-packages/httplib2/__init__.py", line 1360, in _conn_request
raise ServerNotFoundError("Unable to find the server at %s" % conn.host)
ServerNotFoundError: Unable to find the server at accounts.google.com
cleanup alles ältere als 6 Monate
Traceback (innermost last):
File "/usr/bin/duplicity", line 1560, in <module>
with_tempdir(main)
File "/usr/bin/duplicity", line 1546, in with_tempdir
fn()
File "/usr/bin/duplicity", line 1385, in main
action = commandline.ProcessCommandLine(sys.argv[1:])
File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 1127, in ProcessCommandLine
globals.backend = backend.get_backend(args[0])
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/pydrivebackend.py", line 69, in __init__
gauth.CommandLineAuth()
File "/usr/local/lib/python2.7/dist-packages/pydrive/auth.py", line 120, in _decorated
self.Refresh()
File "/usr/local/lib/python2.7/dist-packages/pydrive/auth.py", line 475, in Refresh
self.credentials.refresh(self.http)
File "/usr/local/lib/python2.7/dist-packages/oauth2client/client.py", line 545, in refresh
self._refresh(http)
File "/usr/local/lib/python2.7/dist-packages/oauth2client/client.py", line 761, in _refresh
self._do_refresh_request(http)
File "/usr/local/lib/python2.7/dist-packages/oauth2client/client.py", line 780, in _do_refresh_request
body=body, headers=headers)
File "/usr/local/lib/python2.7/dist-packages/oauth2client/transport.py", line 282, in request
connection_type=connection_type)
File "/usr/local/lib/python2.7/dist-packages/httplib2/__init__.py", line 1694, in request
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/usr/local/lib/python2.7/dist-packages/httplib2/__init__.py", line 1434, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "/usr/local/lib/python2.7/dist-packages/httplib2/__init__.py", line 1360, in _conn_request
raise ServerNotFoundError("Unable to find the server at %s" % conn.host)
ServerNotFoundError: Unable to find the server at accounts.google.com
3 cycles behalten...
Local and Remote metadata are synchronized, no sync needed.
Last full backup date: Sat Dec 29 18:47:31 2018
No old backup sets found, nothing deleted.
done
###### BACKUP DONE on Mon Dec 31 00:00:55 CET 2018 ######
Und so sieht es aus wenn ich es direkt ausführe:
Code: Alles auswählen
###### Starting backup on Mon Dec 31 00:13:03 CET 2018 ######
APT List ...
Done
Dump Database ...
Creating backup for database mysql
Creating backup for database nextcloud
Creating backup for database vmail
Done
mainBackup....
Reading globbing filelist exclude
Local and Remote metadata are synchronized, no sync needed.
Last full backup date: Sat Dec 29 18:47:31 2018
--------------[ Backup Statistics ]--------------
StartTime 1546211588.04 (Mon Dec 31 00:13:08 2018)
EndTime 1546211710.02 (Mon Dec 31 00:15:10 2018)
ElapsedTime 121.98 (2 minutes 1.98 seconds)
SourceFiles 39603
SourceFileSize 4944514868 (4.60 GB)
NewFiles 394
NewFileSize 4626927 (4.41 MB)
DeletedFiles 96
ChangedFiles 1127
ChangedFileSize 620962484 (592 MB)
ChangedDeltaSize 0 (0 bytes)
DeltaEntries 1617
RawDeltaSize 135881922 (130 MB)
TotalDestinationSizeChange 45697350 (43.6 MB)
Errors 0
-------------------------------------------------
cleanup alles ältere als 6 Monate
Local and Remote metadata are synchronized, no sync needed.
Last full backup date: Sat Dec 29 18:47:31 2018
No old backup sets found, nothing deleted.
3 cycles behalten...
Local and Remote metadata are synchronized, no sync needed.
Last full backup date: Sat Dec 29 18:47:31 2018
No old backup sets found, nothing deleted.
done
###### BACKUP DONE on Mon Dec 31 00:15:27 CET 2018 ######
Gruß
EDIT: das hier ist das Backupscript:
Code: Alles auswählen
#!/bin/bash
LOG="/scripts/backup.log"
HOST='repo'
BK_FULL_FREQ="1M" # neues komplettes Backup alle....
BK_FULL_LIFE="6M" # älter als ... löschen
BK_KEEP_FULL="3" # ... volle Backups behalten
cd /scripts/
##Logfdiles
exec > >(tee -i ${LOG})
exec 2>&1
echo "###### Starting backup on $(date) ######"
echo ''
echo "APT List ..."
##Was ist installiert:
dpkg --get-selections > /root/backup/software.list
echo 'Done'
echo ''
echo 'Dump Database ...'
## Datenbanken Dump
/bin/bash /scripts/dbdump.sh
echo 'Done'
echo ''
cd /scripts/
export GOOGLE_DRIVE_SETTINGS=/scripts/credentials
echo 'mainBackup....'
duplicity \
incremental \
--no-encryption \
--full-if-older-than $BK_FULL_FREQ \
--exclude-filelist exclude \
/ \
gdocs://username@gmail.com/Backup
echo ''
echo 'cleanup alles ältere als 6 Monate'
duplicity \
remove-older-than $BK_FULL_LIFE --force \
gdocs://username@gmail.com/Backup
echo ''
echo '3 cycles behalten...'
duplicity \
remove-all-inc-of-but-n-full $BK_KEEP_FULL --force \
gdocs://username@gmail.com/Backup
echo 'done'
echo "###### BACKUP DONE on $(date) ######"
mailx -a "From: „xxxx“ Backup <xxxx@xxxxxx.de>" -s "Backup | "Server xxxxx@xxxxxx.de < $LOG