I need a utility to archive my daily downloaded files into one new folder.
Suppose, I downloaded 10 files today and at the end of the day, all the files should get archived into one new folder with name Archived_TodaysDate.
THIS ACTIVITY/TASK CAN BE SCHEDULABLE AND EXECUTE ON DAILY BASIS.
IT WOULD BE GOOD IF YOU HELP IN THE CONTEXT OF MAC OPERATING SYSTEM.
I know this can be done through many scripting languages but I wanted to know for mac which scripting language is good for this task and a quick start guide.
If you aren't familiar with setting up a chrontab you can set those up by following this (I looked for a mac-specific one but there are zillions of guides about this.)
Your archiving script can be quite simple. Begin by generating a list of files to archive (refer to this answer.)
Unlike in the referenced answer we want a list of files, not a
printed output. So we initialize a list andappendto it at each iteration. Here I assume that your script lives in your downloads folder, but you can change the path given toos.walkas appropriate.We also want a
strftimerepresentation ofnowfor our archive file title.Finally write the files into an archive file (in this case I chose
zipformat).