Sponsored Content
Top Forums Shell Programming and Scripting how to run script? call other script? su to another user? make a cron? Post 302313053 by instant000 on Monday 4th of May 2009 01:35:23 PM
Old 05-04-2009
Java

Quote:
Originally Posted by vbe
And if the second script fail the others are never called?

Why not simply have a script for each user called by root cronfile?
Then the syntax would be in the cron file:
su - <user> -c <your_users_script>
Actually, if any of the three scripts fail, the process fails.

I'm asking because I don't know how to do this.

This is what I know how to do:

su <username>
cd /path/path/path/path
driver1.stop
driver1.start
exit
su <username2>
cd /path/path/path
driver2.stop
driver2.start
exit
su <username3>
cd /path/path/path
driver3.stop
driver3.start

Are you saying that I can schedule them independently of each other?

Due to the nature of the program (drivers for some program to tie into a database), I am not sure if I can do them, except in this order.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Call shell script from php not run ?

Hi. I write a shell script for import data to oracle using sql loader. I set permission 755 or 777 for that script. I can run that script in the consol okay. When I call it from PHP using system command. I got return value 126 this value when don't have permission right ? I check step... (2 Replies)
Discussion started by: raccsdl
2 Replies

2. Shell Programming and Scripting

Can anyone make this script run faster?

One of our servers runs Solaris 8 and does not have "ls -lh" as a valid command. I wrote the following script to make the ls output easier to read and emulate "ls -lh" functionality. The script works, but it is slow when executed on a directory that contains a large number of files. Can anyone make... (10 Replies)
Discussion started by: shew01
10 Replies

3. UNIX for Dummies Questions & Answers

shell script run by user or cron job ?

My shell script runs fine both as a cron job and when i issue it. However, I wish to differentiate when it runs as a cron-job so the "echo" statements are not issued (they get mailed to me, which i don't want). I tried checking $USER but since the cron was created in my user that does not... (5 Replies)
Discussion started by: sentinel
5 Replies

4. Shell Programming and Scripting

howto run remotely call function from within script

Hi I have the following script : #!/bin/ksh #################### Function macAddressFinder ######################## macAddressFinder() { `ifconfig -a > ipInterfaces` `cat ipInterfaces` } ####################################################################### # # print... (2 Replies)
Discussion started by: presul
2 Replies

5. Shell Programming and Scripting

how we can make shell script not to run

Hi,shell script is scheduled from maestro and we want mastero should not run shell script so can we edit the shell script so that it should run.ThanksPrakash (5 Replies)
Discussion started by: prakashdba2010
5 Replies

6. Shell Programming and Scripting

help to make script run recursively

I have this little bash script I use to transcode mkv files using handbrake. #!/bin/bash sourcedir="/media/raid10/video/to_be_encoded_series" destdir="/media/raid10/video/series" cd "$sourcedir" for i in *.mkv; do HandBrakeCLI -i "$i" -o "$destdir/${i%.*}.mkv" -e x264 -q 20.0 -E copy -B... (4 Replies)
Discussion started by: barrydocks
4 Replies

7. Shell Programming and Scripting

Run script through cron with user environment variables

Hi everyone, I wrote a script that is supposed to be run by cron on a daily basis. It works just fine if I run it manually, but due to a lack of environment variables (which are available during my user session but not when cron runs the script) it keeps failing to run successfully. Here's the... (2 Replies)
Discussion started by: gacanepa
2 Replies

8. AIX

Commands to call script work from command line but not from Cron entry

My first post evidently did not materialize so I posted it again: Runnning a cron job every 5 mins to send data files to a state facility. My original cron entry at worked fine: 01,06,11,16,21,26,31,36,41,46,51,56 * * * * /home/sftpuser/stateinoc-from-appname.ksh Somewhere I have a... (1 Reply)
Discussion started by: Skyybugg
1 Replies

9. Shell Programming and Scripting

Bash script from makefile - it is called each time i call make

I've created a tag in the makefile: mytag: $(shell ${PWD}/script.sh) When i do: make clean - the script is executed When i perform make or make mytag the script is again executed with the output: make: Nothing to be done for mytag What i want ? I want script.sh to be executed only... (0 Replies)
Discussion started by: Pufo
0 Replies

10. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies
init-checkconf(8)					      System Manager's Manual						 init-checkconf(8)

NAME
init-checkconf - manual page for init-checkconf SYNOPSIS
init-checkconf [OPTIONS] file init-checkconf [OPTIONS] -f file DESCRIPTION
Determine if specified Upstart init(8) job configuration file is valid. By default, two checks are performed: o Ensure Upstart can parse overall file successfully o Ensure all script sections are parseable by shell OPTIONS
-d , --debug Show some debug output. -f file , --file=file Specify job configuration file to check. -i path , --initctl-path=path Specify path to initctl(8) binary. -s , --noscript Do not check script sections. -x path , --upstart-path=path Specify path to init(8) binary. -h , --help Display usage statement. AUTHOR
Written by James Hunt <james.hunt@ubuntu.com> LIMITATIONS
o This program will not run as the root user. o It is not possible for a user to run multiple simultaneous instances of this program. REPORTING BUGS
Report bugs at <https://launchpad.net/upstart/+bugs> COPYRIGHT
Copyright (C) 2011 Canonical Ltd. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. SEE ALSO
sh(1) init(5) init(8) Upstart 2011-04-06 init-checkconf(8)
All times are GMT -4. The time now is 02:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy