I'm trying to copy pictures taken between two times, from one directory to another.Ive managed to list them using this command find /mnt -type f -name *.jpg -newermt 2014-12-14 01:00:00 ! -newermt 2014-12-14 02:00:00But when I added -exec cp -pf {} /home/pi/box/pictures/ \; to the end, my system locked up; e.g. find /mnt -type f -name *.jpg -newermt 2014-12-14 01:00:00 ! -newermt 2014-12-14 02:00:00 -exec cp -pf {} /home/pi/box/pictures/ \;What have I done wrong?
Copy only files between two times
find
You put the -exec between the quotes that were around the end time, that is not what you want. You should do:find /mnt -type f -name *.jpg -newermt 2014-12-14 01:00:00 ! -newermt 2014-12-14 02:00:00 -exec cp -pf {} /home/pi/box/pictures/ \;(all on one line)