Hi, Hope someone can help me out on this one, I'm pulling my hair out,
Ive made this script but its not working right and I cant see what I have done wrong, The script makes the date folders in the right place but don't move the files at all.
Here is the script ->
Today="`date +YYYY%Y_MM%m_DD%d`"; FromA="00A101104094(B)_1_`date +%Y%m%d*.jpg`"; mkdir /shares/Public/Camera/B/$Today; chmod 777 /shares/Public/Camera/B/$Today; mv /shares/Public/Camera/B/$FromA /shares/Public/Camera/B/$Today;
I have a IP Cam that covers my mum and dads property and when the camera sense's movement it takes pictures and stores them on my WDWB WL NAS storage, the camera saves them to the same folder each time so i use cron and the above script to move the pictures to a folder each hour.
The file names made by the camera are : 00A101104094(B)_1_20101229131208_0.jpg
The first bit '00A101104094' I think is the MAC address of the camera (not really checked)
Then you have the camera name '(B)'
Then a '1' im not sure what that is for
Then '20101229131209' is the date and time what was the 29/12/2010 and the time is 13:12:09
And lastly is the picture number.
The camera saves the photos into : /shares/Public/Camera/B/
I wish to make a folder called YYYY2010MM12DD29 for the 29/12/2010 as when the folders are sorted by name the old ones are first and the new ones are last