Estou usando:
# cat /etc/redhat-release
CentOS release 6.4 (Final)
Tenha um script no crontab do usuário:
$ crontab -l
0 7 * * * /home/teamcity/scripts/TC_backup.sh
Se eu executar este script nesse mesmo usuário, é necessário criar o arquivo:
$ /home/teamcity/scripts/TC_backup.sh
...
E a partir do local-scripts-log:
$ cat /var/log/teamcity_backup.log | tail -n 20
Exporting TeamCity data directory: Exporting build logs
Exporting TeamCity data directory: Exporting personal changes
Finalizing export...
Export has completed successfully.
Backup file created: /home/teamcity/backups/TeamCity_20140117_172034.zip
Backup finished
Done.
Free disc space: 147G;
Used disc space: 125M.
Last archives available:
55M Jan 17 17:21 TeamCity_20140117_172034.zip
55M Jan 17 17:14 TeamCity_20140117_171318.zip
16M Dec 17 18:43 TeamCity_20131217_184333.zip
Backup finished at 2014-01-17--17-21
E possua arquivos:
$ ls -l /home/teamcity/backups/
total 127656
-rw-rw-r-- 1 teamcity teamcity 16777213 Dec 17 18:43 TeamCity_20131217_184333.zip
-rw-rw-r-- 1 teamcity teamcity 56914703 Jan 17 17:14 TeamCity_20140117_171318.zip
-rw-rw-r-- 1 teamcity teamcity 57022673 Jan 17 17:21 TeamCity_20140117_172034.zip
Mas - eu não tenho *.zip
dos outros dias.
No cron-log eu vejo esse script iniciado sem erros:
Jan 12 07:00:01 lms-teamcity CROND[11878]: (teamcity) CMD (/home/teamcity/scripts/TC_backup.sh)
Conteúdo do script:
BDIR="/home/teamcity/backups/"
LOGFILE="/var/log/teamcity_backup.log"
ARHNAME="TeamCity"
backup () {
/home/teamcity/TeamCity/bin/maintainDB.sh backup --all -M -F $BDIR/$ARHNAME >> $LOGFILE
}
backup
Qual pode ser a causa?
UPD: 2 > errorlog.file não dá resultado:
$ crontab -l
0 7 * * * /home/teamcity/scripts/TC_backup.sh 2> /var/log/teamcity_backup_error.log
$ file /var/log/teamcity_backup_error.log
/var/log/teamcity_backup_error.log: empty
No cron-log também não há erros:
...
Jan 20 09:00:01 lms-teamcity CROND[24816]: (setevoy) CMD (/home/setevoy/scripts /db_con_test-4.sh)
Jan 20 09:00:01 lms-teamcity CROND[24818]: (teamcity) CMD (/home/teamcity/scripts/TC_backup.sh 2> /var/log/teamcity_backup_error.log)
Jan 20 09:00:01 lms-teamcity CROND[24817]: (root) CMD (/usr/lib64/sa/sa1 1 1)
...