My machine has a camera attached that can take thousands of jpgs a day.
I am looking for a way of remotely looking at the last 30 to 60 mins of footage via a cloud storage site such as box.com
.
I thought that copying the last 5 mins of files to a mounted remote drive (davfs2) every min and then deleting files each 10 mins that were older than an hour would be a good solution; but it has caused big problems! It caused my machine not to be able to connect via SSH; thus requiring me to power it off.
Now, even if I try and delete the files, it is still re-copying them to the mounted drive. I've had to un-mount the drive, but don't seem to be able to clear the davfs2 cache.
Is there a fundamental problem with my approach?
I put this in my crontab:
*/1 * * * * sudo find /mnt/ -type f -cmin -5 -exec cp -pn '{}' /home/pi/box/street_pictures/ \;
*/10 * * * * sudo find /home/pi/box/street_pictures -cmin +60 -type f -exec rm '{}' \;
/nmt
is the folder with the thousands of pictures.
/home/pi/box/street_pictures
is my mounted drive.