How to select and copy a latest file from a folder to another folder- Ubuntu Script
Background: Once , I had a requirement to find a method to send email alerts with an attached video of the event ,when a motion detection is occurred in Motion Linux . According to my configuration of camera4.conf , the video clips of motion detection events are stored automatically in a folder (motion) at ~/Videos/motion of the computer. My target was to select most resent video clip in ~/Videos/motion and to send email alert attached with the video clip. For the purpose of easy emailing purpose I have decided to create a sub folder called “sub” under ~/Videos/motion ( ~/Videos/motion/sub) to copy selected the latest video clip in to it. Then an Ubuntu script file was prepared to do the above two steps I have tried two methods in two alternative script files successfully ,where the details are appended below. The script files were placed at ~/Documents folder of the computer Method 1 Name of the file mewinu.sh Scripts in mewinu.sh are listed be...