Page 1 of 1

Cron Job for deleting pictures from surveillance camera

PostPosted: Thu Sep 12, 2013 8:19 pm
by ewok11
hi!

i am running a surveillance camera in my storage room in the basement. If it detects motion it sends a picture every second to the share "camera" on my Philips NAS (Firmware 14-0). It works really fine.

Now i tried to delete pictures older than 14 days by defining a cron job:

0 0 * * 1 find /share/1000/camera -mtime +14 -delete {} \;

This is what i found after some research on cron jobs. Unfortunately it does... nothing :-) I tried -delete, -rm and some other combinations. Does anybody have an idea how to get this job working?

Re: Cron Job for deleting pictures from surveillance camera

PostPosted: Thu Sep 12, 2013 8:30 pm
by fvdw
the reason could be that the subfolder were the pictures are stored and the files that are stored there are owned by root with only read permission for others

However cron jobs run with root permissions so it should be able to delete them without changing file permissions :scratch
Are you sure that they are in the folder /share/1000/camera and not in /share/1000/motion-webcam/camera ? (this is the normal setup)

Otherwise check the file and folder permissions, you can change them using the chmod command

Re: Cron Job for deleting pictures from surveillance camera

PostPosted: Thu Sep 12, 2013 9:30 pm
by Jocko
Hi ewok11

Do you note that "0 0 * * 1" means : At each Monday, 00:00 ?

Note : I don't think it's a permission issue as crond is running with root privileges (like FVDW said)

Note2 : I think '{} \;' is useless. Check it directly by giving your command in Putty (it can be used with option -exec)