Dropbox_uploader is specially made for dropbox up/downloading. For a local NAS backup you would need something else. The pimatic-backup plugin should work with probably some patching/rewriting.
-
I installed pimatic new. And still got the following errors.
I think there is something wrong in the plugin:
Pimatic version: 0.9.54
node version: 10.16.3The path that I’ve set up in the plugin is “pimaticbiackup/test/”
{ "debug": true, "interval": 12, "driver": "FTP", "driverOptions": { "host": "XXX.XXX.XXX.XXX", "port": 21, "username": "xxx" "password": "xxx" "path": "pimaticbackup/test/" }, "plugin": "backup", "active": true },
Here is the error:
error [pimatic-backup]: { Error: pimaticbackup/test/1/13/2020, 5:52:21 PM.json: No such file or directory at makeError (/home/pi/pimatic-app/node_modules/pimatic-backup/node_modules/ftp/lib/connection.js:1067:13) at Parser.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-backup/node_modules/ftp/lib/connection.js:113:25) at Parser.emit (events.js:198:13) at Parser._write (/home/pi/pimatic-app/node_modules/pimatic-backup/node_modules/ftp/lib/parser.js:59:10) at doWrite (_stream_writable.js:415:12) at writeOrBuffer (_stream_writable.js:399:5) at Parser.Writable.write (_stream_writable.js:299:11) at Socket.ondata (/home/pi/pimatic-app/node_modules/pimatic-backup/node_modules/ftp/lib/connection.js:273:20) at Socket.emit (events.js:198:13) at Socket.emit (/home/pi/pimatic-app/node_modules/pimatic/startup.coffee:64:24) at addChunk (_stream_readable.js:288:12) at readableAddChunk (_stream_readable.js:269:11) at Socket.Readable.push (_stream_readable.js:224:10) at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17) code: 550 }
-
Hi, the first line of the error indicates a missing directory. I think the plugin (the used ftp library) doesn’t creates directories. When using year/month/day to structure backup, you need automatic creation of subdirectories, otherwise is will be be very much work to prepare the backup directories.
Does backup to the main directory (pimaticbackup/test) work? -
@bertreb said in pimatic-backup:
Hi, the first line of the error indicates a missing directory. I think the plugin (the used ftp library) doesn’t creates directories. When using year/month/day to structure backup, you need automatic creation of subdirectories, otherwise is will be be very much work to prepare the backup directories.
Does backup to the main directory (pimaticbackup/test) work?But why should the plugin create this kind of structure? that makes no sense. I could understand if the strike is like “year/month/day”. A friend of mine uses the same backup plugin with the same pimatic version and node version and on his pimatic the backup plugin works and there is no file structure that has been created.
No the backup never work with my pimatic.
-
@dnl0319 i looked a little deeper into the plugin and the used ftp library creates the year/month/day directories, as part of the functionality. So thats not something you have to do.
Another reason for this error could be the write permission in your ftp server.
The used username should have permission to write files and create directories. -
@bertreb said in pimatic-backup:
@dnl0319 i looked a little deeper into the plugin and the used ftp library creates the year/month/day directories, as part of the functionality. So thats not something you have to do.
Another reason for this error could be the write permission in your ftp server.
The used username should have permission to write files and create directories.Okay that’s not bad but the folders was not created.
I tried this user that I’ve created for this backup and the permission works so the user should have the rights to access the folders.
-
@bertreb said in pimatic-backup:
@dnl0319 accessing (read) is not enough, this user should also have write and create file and directory permission
Yes, the user has also write access…
-
Hi there,
I also set up my system today.
Before the upload went, now the right one would not fit.Upload via the admin account with write access to the folder.
Are there users where the plugin works?
error [pimatic-backup]: { Error: Upload/backuppimatic/1/13/2020, 8:53:39 PM.json: Permission denied. at makeError (/home/pi/pimatic-app/node_modules/pimatic-backup/node_modules/ftp/lib/connection.js:1067:13) at Parser.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-backup/node_modules/ftp/lib/connection.js:113:25) at Parser.emit (events.js:198:13) at Parser._write (/home/pi/pimatic-app/node_modules/pimatic-backup/node_modules/ftp/lib/parser.js:59:10) at doWrite (_stream_writable.js:415:12) at writeOrBuffer (_stream_writable.js:399:5) at Parser.Writable.write (_stream_writable.js:299:11) at Socket.ondata (/home/pi/pimatic-app/node_modules/pimatic-backup/node_modules/ftp/lib/connection.js:273:20) at Socket.emit (events.js:198:13) at Socket.emit (/home/pi/pimatic-app/node_modules/pimatic/startup.coffee:64:24) at addChunk (_stream_readable.js:288:12) at readableAddChunk (_stream_readable.js:269:11) at Socket.Readable.push (_stream_readable.js:224:10) at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17) code: 553 }
-
I think i found the problem and have a solution. But i can’t test it.
The filename of he backup is based on a datestring that contains probably wrong characters. The filename causing the error above is ‘1/13/2020, 8:53:39 PM.json’
It looks like somewhere this filename is not accepted.
The solution is a simpler filename like: /year/month/day/hhmmss-backup.json’Is somebody using this plugin and capable of patching a file? (stopping pimatic, replace a few lines of code and restart pimatic). I will provide ‘a few lines of code’.
-
@bertreb said in pimatic-backup:
I think i found the problem and have a solution. But i can’t test it.
The filename of he backup is based on a datestring that contains probably wrong characters. The filename causing the error above is ‘1/13/2020, 8:53:39 PM.json’
It looks like somewhere this filename is not accepted.
The solution is a simpler filename like: /year/month/day/hhmmss-backup.json’Is somebody using this plugin and capable of patching a file? (stopping pimatic, replace a few lines of code and restart pimatic). I will provide ‘a few lines of code’.
If you say which lines have to be changed, I can do this.
-
If setting the localisation works, this is also a solution.
If you want to patch the code you need to do the following
- stop pimatic (sudo service pimatic stop)
- go to the directory of the pimatic-backup module (/home/pi/pimatic-app/node_modules/pimatic-backup)
- run the command “npm install dateformat”
- change the code in backup.coffee at line 31
current code
timestamp = new Date().toLocaleString()
into new code
dateFormat = require('dateformat') timestamp = dateFormat(new Date(),"yyyy-mm-dd_hhMMss")
- start pimatic again (sudo service pimatic start)
The filename is now without ‘/’ and ‘:’ and should work on all systems.
Let me know what the results are.
-
@bertreb said in pimatic-backup:
If setting the localisation works, this is also a solution.
If you want to patch the code you need to do the following
- stop pimatic (sudo service pimatic stop)
- go to the directory of the pimatic-backup module (/home/pi/pimatic-app/node_modules/pimatic-backup)
- run the command “npm install dateformat”
- change the code in backup.coffee at line 31
current code
timestamp = new Date().toLocaleString()
into new code
dateFormat = require('dateformat') timestamp = dateFormat(new Date(),"yyyy-mm-dd_hhMMss")
- start pimatic again (sudo service pimatic start)
The filename is now without ‘/’ and ‘:’ and should work on all systems.
Let me know what the results are.
Thank you very much for your effort. I will test this tomorrow. I have no time today.
-
This post is deleted!
-
Thank you very much @bertreb , it works now! Great!