Hello freaks
,
I am new here and I am also new in programming bash. I have a question, maybe someone can help me...
So my problem is this: I have to write a bash script which should monitoring the HDD and when for e.g. the HDD is at 75% full, the script sends an email to the admin. The script should also create a cronjob... so here is the section of the script which sends errors:
Code:
if [script -x /usr/local/bin/]; then
(scp script.sh root@SERVER:/usr/local/bin/);
fi
# Cronjob wird per SSH angelegt, es wird überprüft ob der Cronjob schon existiert, falls dies
# Fall ist, wird kein neuer Cronjob angelegt
if [crontab -x /etc/]; then
(ssh root@SERVER 'echo "CRONJOB_ZEILE" >> /etc/cron; /etc/init.d/cron restart');
The following errors appears:
./script1: 6: [script: not found
./script1: 11: [crontab: not found
crontab is installed ...
any ideas??
greetings
mele