Luup code for renaming a file as date and time

HI,

Im trying to set up a scene to capture a image from my camera on a scene execution. So far I have managed to be able to pull the image with a os.execute but im unable to get it to rename.

My basic lua is :

os.execute(“wget http://192.168.0.18:9040/snapshot -P /root/nas1/foscam/”)
luup.call_delay(5)
os.execute(“mv snapshot $(date +%F-%H:%M).jpg”)

The mv command works in ssh as standard mv command but not in my scene? Can anyone help?

Thanks

John

Sorry it works if I add full file path :slight_smile:

There is also the native Lua routine [tt]os.rename()[/tt] that you could use in future.