ERPNext Backup auf externen Speicher

Ein Raspberry ist zwar gut, klein und günstig sollte aber trotzdem gesichert werden. Diese Daten sind schließlich das Herzstück des Unternehmen. Hierfür ist rclone vorinstalliert

 · 5 min read

Ihr könnt unter SSH mit den Programm Putty und den Befehl

ubuntu@erpnext-pi:~$ rclone config

einen Speicherort anlegen.

Ihr müsst entsprechend 2 Ziele anlegen, einmal den entfernten Speicherort und unseren Lokale Speicherort.

In unseren Beispiel

ubuntu@erpnext-pi:/opt/bench/erpnext$ rclone config
2021/02/27 17:35:17 NOTICE: Config file "/home/ubuntu/.config/rclone/rclone.conf" not found - using defaults
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n

In unseren Beispiel nehmen wir nehmen wir eine Nextcloud

name> Cloud
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
1 / 1Fichier
  \ "fichier"
2 / Alias for an existing remote
  \ "alias"
3 / Amazon Drive
  \ "amazon cloud drive"
4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc)
  \ "s3"
5 / Backblaze B2
  \ "b2"
6 / Box
  \ "box"
7 / Cache a remote
  \ "cache"
8 / Citrix Sharefile
  \ "sharefile"
9 / Dropbox
  \ "dropbox"
10 / Encrypt/Decrypt a remote
  \ "crypt"
11 / FTP Connection
  \ "ftp"
12 / Google Cloud Storage (this is not Google Drive)
  \ "google cloud storage"
13 / Google Drive
  \ "drive"
14 / Google Photos
  \ "google photos"
15 / Hubic
  \ "hubic"
16 / JottaCloud
  \ "jottacloud"
17 / Koofr
  \ "koofr"
18 / Local Disk
  \ "local"
19 / Mail.ru Cloud
  \ "mailru"
20 / Microsoft Azure Blob Storage
  \ "azureblob"
21 / Microsoft OneDrive
  \ "onedrive"
22 / OpenDrive
  \ "opendrive"
23 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
  \ "swift"
24 / Pcloud
  \ "pcloud"
25 / Put.io
  \ "putio"
26 / SSH/SFTP Connection
  \ "sftp"
27 / Transparently chunk/split large files
  \ "chunker"
28 / Union merges the contents of several remotes
  \ "union"
29 / Webdav
  \ "webdav"
30 / Yandex Disk
  \ "yandex"
31 / http Connection
  \ "http"
32 / premiumize.me
  \ "premiumizeme"
Storage> 29
** See help for webdav backend at: https://rclone.org/webdav/ **

URL of http host to connect to
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
1 / Connect to example.com
  \ "https://example.com"
url> https://cloud.*******.de/remote.php/dav/files/***Username***/Backup/ERPNext

Wie oberhalb zu sehen ist gebt ihr eure webdav Adresse als Ziel an

Name of the Webdav site/service/software you are using
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
1 / Nextcloud
  \ "nextcloud"
2 / Owncloud
  \ "owncloud"
3 / Sharepoint
  \ "sharepoint"
4 / Other site/service or software
  \ "other"
vendor> 1

Hier geben wir 1 für die Nextcloud an

User name
Enter a string value. Press Enter for the default ("").
user> Joe
Password.
y) Yes type in my own password
g) Generate random password
n) No leave this optional password blank
y/g/n> y

Wir wollen unser Passwort eingeben oder nehmen ein generiertes unter unseren Nextcloud Einstellungen.

Enter the password:
password:
Confirm the password:
password:
Bearer token instead of user/pass (eg a Macaroon)
Enter a string value. Press Enter for the default ("").
bearer_token>

Wir haben keinen Bearer Token

Edit advanced config? (y/n)
y) Yes
n) No
y/n> n
Remote config
--------------------
[Cloud Equi]
url = https://cloud.equivalents.de/remote.php/dav/files/Joe/Backup/ERPNext
vendor = nextcloud
user = Joe
pass = *** ENCRYPTED ***
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:

Name                 Type
====                 ====
Cloud                webdav

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> n

Fertig mit unseren Remote Speicherort, jetzt legen wir unseren Lokalen an.

Wir legen hier nur einen Speicherort an ohne Pfad.

name> Lokal
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
1 / 1Fichier
  \ "fichier"
2 / Alias for an existing remote
  \ "alias"
3 / Amazon Drive
  \ "amazon cloud drive"
4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc)
  \ "s3"
5 / Backblaze B2
  \ "b2"
6 / Box
  \ "box"
7 / Cache a remote
  \ "cache"
8 / Citrix Sharefile
  \ "sharefile"
9 / Dropbox
  \ "dropbox"
10 / Encrypt/Decrypt a remote
  \ "crypt"
11 / FTP Connection
  \ "ftp"
12 / Google Cloud Storage (this is not Google Drive)
  \ "google cloud storage"
13 / Google Drive
  \ "drive"
14 / Google Photos
  \ "google photos"
15 / Hubic
  \ "hubic"
16 / JottaCloud
  \ "jottacloud"
17 / Koofr
  \ "koofr"
18 / Local Disk
  \ "local"
19 / Mail.ru Cloud
  \ "mailru"
20 / Microsoft Azure Blob Storage
  \ "azureblob"
21 / Microsoft OneDrive
  \ "onedrive"
22 / OpenDrive
  \ "opendrive"
23 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
  \ "swift"
24 / Pcloud
  \ "pcloud"
25 / Put.io
  \ "putio"
26 / SSH/SFTP Connection
  \ "sftp"
27 / Transparently chunk/split large files
  \ "chunker"
28 / Union merges the contents of several remotes
  \ "union"
29 / Webdav
  \ "webdav"
30 / Yandex Disk
  \ "yandex"
31 / http Connection
  \ "http"
32 / premiumize.me
  \ "premiumizeme"
Storage> 18
** See help for local backend at: https://rclone.org/local/ **

In der aktuellen Version ist die 18 Lokal.

Disable UNC (long path names) conversion on Windows
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
1 / Disables long file names
  \ "true"
nounc>

einfach Enter drücken

Edit advanced config? (y/n)
y) Yes
n) No
y/n> n
Remote config
--------------------
[Lokal]
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:

Name                 Type
====                 ====
Cloud                webdav
Lokal                local

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q

Am ende beenden wir die Config.


Jetzt wollen wir unsere Backups hochladen dies geht mit den einfachen Befehl:

rclone sync Lokal:/opt/bench/erpnext/sites/erpnext-pi/private/backups/ "Cloud":Backup/

Mit diesen Befehl sollten eure Backups in der Cloud sein.

Um die Cloud aktuell zu halten brauchen wir noch eine Aufgabe die das ganze aktuell hält.

ubuntu@erpnext-pi:~$ crontab -e
Select an editor.  To change later, run 'select-editor'.
 1. /bin/nano        <---- easiest
 2. /usr/bin/vim.basic
 3. /usr/bin/vim.tiny
 4. /bin/ed

Choose 1-4 [1]: 1

Wir nehmen nano


30 */6 * * * rclone sync Lokal:/opt/bench/erpnext/sites/erpnext-pi/private/backups/ "Cloud":Backup/

Wir diese Zeile hinzu, 30 Minuten nach dem Backuplauf von ERPNext synchronisiert unser rclone die Dateien hoch in die Nextcloud.

Um den Editor zu verlassen drücken wir strg + x, dann frägt er ob wir speichern wollen und welcher Dateiname. Dateiname wird bestätigt und y für speichern.


No comments yet.

Einen Kommentar hinzufügen
"Strg + Enter" um Kommentar hinzuzufügen