This software allows to sync a group of files between devices w difficult access:
- Pixracer (mavros ftp)
- FlirDuo (external flash drive)
- Websites (POST requests, developed for logs.px4.io)
- FTP servers
For start ftp-server use:
git clone https://github.com/urpylka/filesync
cd filesync
mkdir temp
sudo ./src/ftp_server.py
For start filesync manager use:
git clone https://github.com/urpylka/filesync
cd filesync
mkdir temp
sudo ./src/manager.py config.json
Also there are deploy scripts: deploy-filesync.sh
, deploy-ftp.sh
. It creates services, adds them to autostart and starts them.
rm -f flir/db.json && clear && sudo ./src/manager.py
while :; do sleep 1; clear; ls -l Sherlock.s03e01.avi; done
Some devices:
"source": {
"device_class": "DISK",
"module_path": "device_disk",
"args": {
"uuid": "D1C6-0146",
"mount_point": "/mnt"
}
},
"target": {
"device_class": "FTP",
"module_path": "device_ftp",
"args": {
"host": "192.168.20.131",
"user": "test-1",
"passwd": "passwd"
}
},
"source": {
"device_class": "LOCAL",
"module_path": "device_local",
"args": {
"dir": "/home/pi/worker1"
}
},
"target": {
"device_class": "POST",
"module_path": "device_post",
"args": {
"uploader_url": "https://logs.px4.io/upload",
"values": {
"description": "",
"additional_feedback": "",
"email": "email@test.com",
"allow_for_analysis": false,
"obfuscated": false
}
}
},
"target": {
"device_class": "WEBDAV",
"module_path": "device_webdav",
"args": {
"host": "https://webdav.yandex.ru",
"user": "login",
"passwd": "passwd"
}
},
SOURCE -> LOCAL -> TARGET
All sources & targets must be inherited from device_abstract.py
.
The local storage placed on computer where executing this program.
Program wrote by pubsub technology & consist three workers:
- Finder – searching new files on source and adding those to DB and DownloadQueue.
- Downloader – downloading files from source to local which contain in DownloadQueue and adding those to DB and UploadQueue.
- Uploader – uploading files from local to target which contain in UploadQueue and adding those to DB.
- The asynchronous DB based on JSON file
json_array.py
. - Internet/connection checker.
Other information you can find in devnotes.