Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
when i run it in crontab, i saw the error below;
myscript.sh: line 29: sqlplus: command not found
mv: cannot stat ‘/20210317.tmp’: No such file or directory
but it works fine when i am running it with nohup. what could be the reason about why this script is not working with crontab? i checked the permissions and it seems fine. do you have any idea?
PATH in crontab is usually set to /usr/bin:/bin by default (in Vixie Cron, at least). Either set PATH in the crontab file or (better) use the absolute path to sqlplus.
1. use shellcheck to analyze your script
2. show your script, what you posted is just incorrect [syntactically].
3. did you adjust the variable PATH at all?
1. use shellcheck to analyze your script
2. show your script, what you posted is just incorrect [syntactically].
3. did you adjust the variable PATH at all?
Hi, dear friend,
because of privacy i am not able to share all script there,
i couldnt send you private message, if there is a way to share it with you let me know and i can send it to you.
thank you in advance.
Hi, dear friend,
because of privacy i am not able to share all script there,
i couldnt send you private message, if there is a way to share it with you let me know and i can send it to you.
thank you in advance.
No one is asking for the entire script. Pair it down to the essential part that is not working and show us just that running
on its own and the associated error messages
No one is asking for the entire script. Pair it down to the essential part that is not working and show us just that running
on its own and the associated error messages
Dear my friend,
there is the all script.
thank you.
With all those double quotes, you're bound to miss one and get one of those confusing error messages that point to the end of the file. (And the braces keep you out of trouble when combining variables and other text.) You could also "variablize" the script a bit more (i.e., TMPFILE="...", LOGFILE="...", etc.) IMHO, it enhances the readability.
Finally, that "sqlplus" command: Is that wrapped somehow? The line under the sqlplus doesn't make sense. Is there a missing backslash escaping the newline at the end of the sqlplus command string? I.e.:
Code:
sqlplus ... ... ... \
$WORK > your-log-file 2>&1
BTW, if that's the case, you want the "" to be the absolute last character on the line. If it's not you might be escaping a space instead of the new line.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.