Here is the code of the script. Store it as myscript.sh
Code:
#!/bin/bash
MOMENT=$(date +%Y.%m.%d_%H%M%S)
cp /path/to/your/log/files/here.log /path/to/your/backup/here.$MOMENT.bak
gzip /path/to/your/backup/here.$MOMENT.bak
And edit your crontabs using the command
(you will have to know the vi editor)
Then paste this job:
Code:
#0 1 * * * /path/to/your/script/myscript.sh