By continuing to use the site, you agree to the use of cookies. more information
The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.
Monat: Januar 2017
Es muss eine SSH Verbindung zum Synology NAS vorhanden sein. Als erstes muss folgendes Ausgeführt werden: Anleitung lokaler Server = NAS remote Server = NextCloud Server Anstelle von “nano”, “vi” verwenden. Nun kann folgendes Script auf dem NAS gespeichert und angepasst werden. Alle Variabeln setzen.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #!/bin/bash host=$"" user=$"" mysql_user=$"" mysql_pass=$"" nextcloud_db=$"" src_nextcloud=$"" dst_nextcloud=$"" src_mysql=$"" dst_mysql="" at=$"@" point=$":" #export nextcloud database on server ssh $user$at$host 'mysqldump -u '$mysql_user' -p'$mysql_pass' --databases '$nextcloud_db' > '$src_mysql'' #sync nextcloud files and exported database to NAS rsync -avz -e ssh $user$at$host$point$src_nextcloud $dst_nextcloud rsync -avz -e ssh $user$at$host$point$src_mysql $dst_mysql |
Das Script ausführbar machen:
1 | chmod +x pfad_zum_script |
In der NAS…
https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys–2 Auf dem lokalen Server, der später die SSH Verbindung starten soll. Achtung: Keyfilepath beachten
1 2 3 4 5 6 7 | ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/demo/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/demo/.ssh/id_rsa. Your public key has been saved in /home/demo/.ssh/id_rsa.pub. |
Nun das Keyfile öffnen und den kompletten Inhalt kopieren.
1 | nano pfad_zum_keyfile |
Auf dem remote Server, auf den per SSH verbunden wird. userverzeichnis = Verzeichnis des Benutzers, der beim SSH Login verwendet wird.
1 | nano userverzeichnis/.ssh/authorized_keys |
Nun den kopierten Inhalt einfügen und speichern….
By continuing to use the site, you agree to the use of cookies. more information
The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.