crontab doesn't works
hi everyone...
my crontab is configured to make backup of some stuff with TAR and send it to other pc with SCP... there are 2 pcs with the same problem and different backup scripts... the problem is... when the crond stars to create the tar.gz file with the backup it creates a file with 148kb and the backup have 997mb... the permissions are OK... I created a script: #!/bin/sh ls -laht > /root/resul_teste script permissions: -rwxr-xr-x 1 root root 39 Jul 3 13:51 teste.sh crontab: 53 13 * * * /root/teste.sh and it works fine... but the backup script... nothing: crontab: 30 12,21 * * * root /root/backup-www.sh backup script: #!/bin/sh cd /bkp/ a=http-`date +%d%m%Y%H%M` echo "Entrei-Backup-fontes-http"-$a >> /var/log/bkp_bancos /bin/tar cvzf /bkp/$a.tar.gz /var/www/html/ scp /bkp/$a.tar.gz root@192.168.2.5:/bkp/192.168.1.2 echo "backup-fontes"-$a >> /var/log/bkp_bancos answers? |
This is the syntax for a user cron:
Code:
53 13 * * * /root/teste.sh Code:
30 12,21 * * * root /root/backup-www.sh |
the paths are OK... the tar path too... 'cause it creates a file .tar.gz but the size is 148k instead of 997mb (real size). I'm sure of it cause when I executed the script it worker pretty well... (i'm doing it every day)... i'm putting the backup command on /etc/crontab so... the syntax is correct, isn't it?
|
What's in the tar file?
|
Checked your other post and you mention using Fedora. Is this the distro you are asking the question about? If so then maybe you could place your script in one of the /etc/cron.daily subdirectory or other related depending on when you want it to run. See it works that way.
Brian |
Quote:
|
Quote:
|
I mean, if you can't find any useful error messages, then you might be able to diagnose the problem based on what got tarred -- i.e. untar the thing (or, do a 'tar tzf') and see what's in it.
|
ok... inside the incomplete tar... it's like it started compacting and something cancels... than the file is incomplete... but inside it there's some files from the folder i wanted to compact...
|
If this is not an error, then it possibly has to do with dereferencing symbolic links. When you computed the size of the directory, you might have dereferenced the links, while tar doesn't derefernce links (by default), making it appear as if there is a size discrepancy between the tar file and the original directory.
|
this directory have no symbolic links... only dba files and mail attachments...
|
All times are GMT -5. The time now is 12:15 PM. |