Salve a tutti!
Ho un problema con degli script cron.
Nella cartella /myscript/ ho due script con permessi di root e u+x:
uno è il seguente:
#! /bin/sh
data=`date +%Y%m%d%H%m`
tar -czvf prova.$data.tar /var/www/html/cartellasito
mv prova.$data.tar /home/server/Desktop/backup/SERVER/
rm -fR printergest.$data.tar
L’altro è:
#! /bin/sh
data=`date +%Y%m%d%H%m`
mysqldump -uroot -ppwd --opt nomedb > /home/server/Desktop/backup/SERVER/mysqldump_printerdb_$data.sql
Il file /etc/crontab è configurato in questa maniera:
[code]SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
11 * * * * root run-parts /scriptcron/copy.sh
11 * * * * root run-parts /scriptcron/mysqldumpcron.sh[/code]
Poi i due file sono stati copiati nella cartella /etc/cron.hourly/ per eseguire la copia ogni ora.
La cosa strana è che i due script sono funzionanti, se gli lancio da shell sono perfetti, mentre se gli esegue cron non producono nessun risultato e nemmeno nessun errore.
Dov’è l’inghippo???
Sicuramente mi sta sfuggendo qualcosa, qualcuno può darmi qualche dritta???