I would like to be able to tar (zip) the contents of a folder containing multiple log files from a tracking script at 12:01 am on the 1st of every month and place the archived files in a different folder out of the way.
Can you help?
Your basic shell script would be something like:
#!/bin/bashcd /path/to/logs/folder
tar cv * > logs.tar
mv logs.tar /out/of/the/way
You might want to add in a 'rm *' as the last line to get rid of the old log files.
Then create a text file containing:
1 0 1 * * nameofscript
and issue 'crontab nameoftextfile'
The 'cv' option means create & verbose - create is for a new archive (another option is 'a' for append onto an existing archive), and do it verbosely (ie show as much information as possible).
The * just means add every file to the archive.
The default destination for tar's output is the screen, so the > tells *nix that you want to redirect the output to somewhere else - in this case 'logs.tar'
Keep on with the penguinese - you'll be thinking in heiroglyphics in no time :)