aaronwmorris / indi-allsky

Software to manage a Linux-based All Sky Camera.
GNU General Public License v3.0
196 stars 31 forks source link

Best way to refresh the database if images removed #1244

Closed smokedsalmonbagel closed 1 month ago

smokedsalmonbagel commented 2 months ago

I am syncing detection images to an archival server and want to remove the old media after a certain number of days. I couldn't find a way to remove old images in indie-allsky. If I remove the files do they ever get removed from the database? Is there a procedure for checking for deleted files and removing them?

aaronwmorris commented 2 months ago

If you manually delete files, you can use the Validate DB option under System -> Utilities to clean up orphaned database database entries.

smokedsalmonbagel commented 2 months ago

Thanks. Exactly what I was looking for. I invoked this with the following:

cd ~/indi-allsky/virtualenv/indi-allsky
source bin/activate
python3 ~/indi-allsky/misc/validate_db_entries.py -y

To run this from a script I added a -y option:

https://gist.github.com/smokedsalmonbagel/93d11adf1d3e94c5745e3ffd9733866f

aaronwmorris commented 2 months ago

Yep, that script performs the same exact function. I just did not mention it for the sake of simplicity.