voici mon probleme : automatisation d'une tâche CRON :
script shell sous red hat dans le repertoire : /home/bddbackup/
#!/bin/bash
DATE=`Date +"%y%m%d"`
DBOST ='localhost'
DBUSERNAME='root'
DBPASSWORD='xxxxxxx'
/usr/bin/mysqldump -h DBOST -u DBUSERNAME -pDBPASSWORD -A > /home/bddbackup/alldatabases_$DATE.sql
Exécution de la tâche : dans etc/crontab :
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
(…)