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.
well, after fighting with RHELAS4 I've configured the dovecot POP3, the postfix, samba, VNC, users & groups, firewall, network, ups service and finally crontab.
In order to make backups, I use taper (I cannot post a link until my 4th post so if you want you can search taper in google (second option)).
The only problem that I still have is that when I try to start that program (taper) from the command line it works like charm [# taper -T scsi (enter)], but when I try to start it up from the crontab using the start_taper script or when I try to call that script in the command line [/root/taper/start_taper (enter)]
I get the message:
[bash: /root/taper/start_taper: permission denied]
Never used taper. That said - two different things likely here.
Issue 1:
The message you get trying to run the script from the command line indicates you don't have permission to run the script rather than the taper command itself.
From the way you wrote your taper syntax with the # at beginning of line it appears to be the root PS1 prompt so you're running as root when you do that and it works. For your script you show only the error and not actually the command line you ran. Were you root when you tried to run the script?
Do "ls -l /root/taper/start_taper". Does this show "root" as the owner? Does it show execute bit for the owner - for example:
-rwxr--r-- 1 root nagios 16 Oct 31 2005 test.sh
Shows root as the owner, nagios as the group. Owner has r(ead), w(rite) and e(x)execute. group only has read and all others only have read.
Issue 2:
Items run from command line inherit the logged in user's environment. Items run from cron do NOT inherit an environment. Therefore you have to make sure the full path to commands they are going to use are included in the script. So if taper were in /usr/bin rather than having your line say "taper -T scsi" in the script you'd want it to say "/usr/bin/taper -T scsi". From command line you can determine where taper is by typing "which taper". Note this is true of any command you want to run that is not internal to the shell.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.