Ola,
Aqui tens um exemplo de script que te pode servir
mas ha diferentes maneiras de criar um script.
Depois é so adicionar o script ao contrab
#!/bin/bash
#Defines our output file
OUTPUT=/some/directory/to/store/the/backup_$(date +%Y%m%d).tgz
#Defines our directory to backup
BUDIR="/some/directory/to/backup/"
#Display message about starting the backup
echo "Starting backup of directory $BUDIR to file $OUTPUT"
#Start the backup
tar -cZf $OUTPUT $BUDIR
#Checking the status of the last process:
if [ $? == 0 ]; then
#Display confirmation message
echo "The file:"
echo $OUTPUT
echo "was created as a backup for:"
echo $BUDIR
else
#Display error message message
echo "There was a problem creating:"
echo $OUTPUT
echo "as a backup for:"
echo $BUDIR
fi