need help in script
Hello,
i need to make script and i know basic scripting. we generate report in server every day and copy this report to perticular folder. i want to create script which transfer the file to given folder as per modification date. ex report 14/12/2016 report 15/12/2016 if i run script in 15 dec so that script have to copy 15th dec file not 14th. same for coming days. please help me on that |
If you are decent with bash, you should really show your work. And share the actual filenames. That way we don't have to guess like I have here.
If they are named with the date then you can simply copy it with a date of today: Code:
today=$(date +%d-%m-%Y) Code:
newest=$(ls -t report* | head -n1) Code:
touch -t $(date +%m%d0000) /tmp/today |
All times are GMT -5. The time now is 11:01 PM. |