django-dbbackup
django-dbbackup copied to clipboard
SFTP backup is buggy (fixable)
I had problems with backing up data to SFTP as mentioned here: https://github.com/jschneier/django-storages/issues/199
But, playing with the settings and some input from @jbittel I finally make it work!
Here are working settings:
DBBACKUP_STORAGE = 'storages.backends.sftpstorage.SFTPStorage'
DBBACKUP_STORAGE_OPTIONS = {
'host': '___hostname___',
'params': {
# 'hostname': '___hostname___',
'username': '___username___',
'password': '___password___',
},
'known_host_file': 'known_hosts',
'root_path': '___root_path___',
}
One thing very important is, you need to get rid of hostname param from params. Otherwise you will get connect() got multiple values for argument 'hostname'.
One thing that must be mentioned in docs is that known_host_file must be present with 644 rights.
@adi- Ok, thank you very much for this debugging and explanation. We'll make improvement from that.
I have read through the several issues on this matter and attempted to do this. I am still getting the same error that was described.
self._system_host_keys = HostKeys() RecursionError: maximum recursion depth exceeded
Can you not specify ~/.ssh/known_hosts in the known_host_file parameter?
I still can't make it work, in my case, there's no error. The code is just stuck at 'Writing file to default-home-2018-11-26-184715.psql' for hours. Any fixes?