I've taken this:find -maxdepth 1 -mtime +1 -type f -exec cp '{}' backup \;Which should copy all the regular files in the current directory more than 1 day old to the directory backup (assuming the directory backup exists).And this:find . -mmin -40                 Which should find files modified in the last 40mins.To give this:find -mmin -30 -exec cp '{}' backup \;But I'm not sure what to do next.How can I modify the above statement to copy all files and directories from /nmt to /home/pi/box/street_pictures for the last 30 min, overwriting what was previously in/home/pi/box/street_pictures.I, in effect, want half an hour rolling snapshot of pictures taken and placed in the /nmt directory to be present in the /home/pi/box/street_pictures directory.If I run this command each min, is it possible to do this so I don't have to clear the directory and re-copy the full hour each time?
rolling snapshot of pictures taken in the last half hour
find;cp
To copy the files that are less than 30 minutes old (but don't overwrite files):find /nmt/ -cmin -30 -type f -exec cp -pn '{}' /home/pi/box/street_pictures/ \;Then to remove files in /home/pi/box/street_pictures that are older than 30 minutesfind /home/pi/box/street_pictures -cmin +30 -type f -exec rm '{}' \;If each of these acts as you like you could put them in a script and run that script in cron each minute or whatever time window you feel is best.