This is the case, I made 3 files to execute backup database command in rman
test.sh:
#!/bin/bash
sqlplus /nolog @/u01/conectar.sql
conectar.sql:
connect sys/manager as sysdba
ho rman target mydatabase/mypassword @/u01/backup.sh
backup.sh:
#!/bin/bash
RUN {backup database;}
and then I did all the chmod u+x
for the files to make them executable, then export EDITOR=nano
to change the cron editor.
when I go to crontab -e i put
00 15 * * * /u01/test.sh
If I clic this test.sh manually, the operation runs normally, but then in the crontab I get the "you got a mail" thing with this message
From root@localhost.localdomain Thu Dec 22 16:20:01 2016 Return-Path: X-Original-To: oracle Delivered-To: oracle@localhost.localdomain Received: by localhost.localdomain (Postfix, from userid 500) id 956CD41D4B; Thu, 22 Dec 2016 16:20:01 -0400 (AST) From: root@localhost.localdomain (Cron Daemon) To: oracle@localhost.localdomain Subject: Cron /u01/test.sh Content-Type: text/plain; charset=UTF-8 Auto-Submitted: auto-generated X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: Message-Id: <20161222202001.956CD41D4B@localhost.localdomain> Date: Thu, 22 Dec 2016 16:20:01 -0400 (AST) /u01/test.sh: line 3: sqlplus: command not found"
Please can you remake the script or the crontab for me? If you can answer with the exactly modifications I would appreciate it, I'm not an expert in this environment so a general knowledge needed answer will leave me the same, thanks.