Hi,
I save my webcam pictures under /etc/openhab2/html:
var SimpleDateFormat df = new SimpleDateFormat( "YYYYMMdd_HH:mm:ss" )
var String Timestamp = df.format( new Date() )
executeCommandLine("wget http://user:pass@ip/cgi-bin/viewer/video.jpg -O /etc/openhab2/html/BWL_" + Timestamp + ".jpg",2000)
Now I want to have a daily rule, which should delete old pictures:
rule "taegliche"
when Time is midnight
then
//get all files from "/etc/openhab2/html/"
executeCommandLine("ls /etc/openhab2/html/ to ...???
//loop over files; check if date older then 3 weeks, if yes, delete file
end
is it possible? Can someone help?
In the long turn I want to save my pictures in google photes. Maybe someone do it already and can give me a hint… maybe with IFTTT??
kind regards