I'm using:# cat /etc/redhat-releaseCentOS release 6.4 (Final)Have an script in user's crontab:$ crontab -l0 7 * * * /home/teamcity/scripts/TC_backup.shIf I run this script under this very user - it's create needed archive:$ /home/teamcity/scripts/TC_backup.sh...And from local-scripts-log:$ cat /var/log/teamcity_backup.log | tail -n 20Exporting TeamCity data directory: Exporting build logsExporting TeamCity data directory: Exporting personal changesFinalizing export...Export has completed successfully.Backup file created: /home/teamcity/backups/TeamCity_20140117_172034.zipBackup finishedDone.   Free disc space: 147G;   Used disc space: 125M.   Last archives available:55M Jan 17 17:21 TeamCity_20140117_172034.zip55M Jan 17 17:14 TeamCity_20140117_171318.zip16M Dec 17 18:43 TeamCity_20131217_184333.zip   Backup finished at 2014-01-17--17-21And have files:$ 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.zipBut - I haven't any *.zip from other days.In cron-log I see that script started without errors:Jan 12 07:00:01 lms-teamcity CROND[11878]: (teamcity) CMD (/home/teamcity/scripts/TC_backup.sh)Contents of the script:BDIR=/home/teamcity/backups/LOGFILE=/var/log/teamcity_backup.logARHNAME=TeamCitybackup () {    /home/teamcity/TeamCity/bin/maintainDB.sh backup --all -M -F $BDIR/$ARHNAME >> $LOGFILE}backupWhat can be the cause?UPD: 2> errorlog.file doesn't give result:$ crontab -l0 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: emptyIn cron-log also no any errors:...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)...
Script from cron doesn't create archive
cron;backup
ause was in JAVA_HOME variable, as it needed by maintainDB.sh script.So, getting info from script running from cron:getenv () {env >> $BDIR/envlog.log}...getenv;...And than checking file to variable:$ cat envlog.log | grep JAVAShow nothing.After adding:...export JAVA_HOME=/usr/java/jdk1.6.0_45/export JAVA_OPTS=-Xmx1536m -XX:MaxPermSize=768mexport JRE_HOME=/usr/java/jdk1.6.0_45/jre...In to this very backup script TC_backup.sh - all work good.