Script to copy all AllSky images and videos to an FTP server #4534
Replies: 2 comments 4 replies
-
@chvvkumar, Are you wanting suggestions on how to improve it or make it more usable by others? This could be a good addition to the Did you consider configuring your NAS as a Remote Server so every image is automatically uploaded after it's taken? I'll look at the script more closely when I'm on my PC, but it's possible the Remote Server functionality would eliminate the need to constantly run the script. |
Beta Was this translation helpful? Give feedback.
-
@chvvkumar, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I wrote this shell script to copy all the images that my AllSky camera takes to my NAS. My reason for this is to save these images to train my ML model better. Thought I would share it in case someone else finds use for it.
Name of the script file
sync_allsky.sh
Command-Line Options:
-f
: Perform a full recursive sync (all files and directories)-i <minutes>
: Set the sync interval in minutes (default: 5)-o
: Run once and exit (can be combined with other options)Make script executable:
chmod +x sync_allsky.sh
Initial full sync to copy all existing images:
./sync_allsky.sh -f -o
specify a different interval (e.g., 10 minutes):
./sync_allsky.sh -i 10
Create a systemd unit file for installing this script as a service with the name
allsky-sync.service
:[Unit] Description=AllSky Images FTP Sync Service After=network.target [Service] Type=simple User=pi # Run with full sync at startup, then continue with 5-minute interval syncs ExecStart=/home/pi/sync_allsky.sh -f -i 5 Restart=on-failure RestartSec=10s [Install] WantedBy=multi-user.target
Start the service and set it to run on boot:
sudo cp allsky-sync.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl start allsky-sync.service sudo systemctl enable allsky-sync.service
Check status of the service:
Beta Was this translation helpful? Give feedback.
All reactions