Sponsored Content
Top Forums Shell Programming and Scripting while loop not working in cronjob Post 302607857 by ankush_mehra on Thursday 15th of March 2012 01:31:53 PM
Old 03-15-2012
while loop not working in cronjob

Hi ,
While loop is not working when running script as cronjob.
Code:
#!/usr/bin/bash
 
xyz
sleep 30
var=0
while [ $var -le 100 ]
do
xyz commands
done

This script is working if I run it manually.

Last edited by ankush_mehra; 03-15-2012 at 03:57 PM.. Reason: Code tags, please.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sftp not working as cronjob

hi, I have a script that will automatically login into a server and get a file. it is working fine if i run it on a command line. however, when i tried to run it as a cron job, it is not working. what should i do? set timeout -1 spawn /usr/bin/sftp user1@server1 match_max 100000 expect... (3 Replies)
Discussion started by: tungaw2004
3 Replies

2. UNIX for Advanced & Expert Users

cronjob not working

I created a file in /u01/oradata directory as cronjb.ksh which contains following script 30 12 * * * /export/home/oracle/u01/oradata/rman.ksh '/export/home/oracle' is my root directory. I then moved cronjb.ksh file to my '/export/home/oracle' directory. i typed crontab cronjb.ksh. However my... (8 Replies)
Discussion started by: manna
8 Replies

3. Solaris

cronjob not working

I am trying to schedule a job via cronjob. Not sure what the problem is. below is my script and the error. 45 10 * * * /u01/app/oracle/jpark/sched_exp_mis.sh Error received. Your "cron" job on tama /u01/app/oracle/jpark/sched_exp_mis.sh produced the following output: ... (19 Replies)
Discussion started by: mrx1350
19 Replies

4. Solaris

cronjob not working

Hi All , I have a cron jobs that is not working while put inside cron. But on executing from manually, it works fine, Pl anyone find if there is anything wrong in the script. 30 22 * * 1-5 cd /home/ab90737/introscope/util/bin; ./batchgenerateReport.pl ../config/reps.config >... (1 Reply)
Discussion started by: jegaraman
1 Replies

5. UNIX for Advanced & Expert Users

cronjob not working intermittently

Hi there I have a cronjob running on a sol 10 U6 server which runs every 15 minutes. The cronjob is a perl script. But I have noticed that after every few weeks the job stops running all of a sudden. There are other cronjobs running on the system from the same user and from other users which... (3 Replies)
Discussion started by: sinfuldips
3 Replies

6. Shell Programming and Scripting

Cronjob not working from user's crontab

Hi All, I am trying to execute a python script from a user's crontab. /home/user1/UDE/scripts/UdeManager.py I am at /home/user1. If I run the command "/home/user1UDE/scripts/UdeManager.py" from the users home directory its working fine. But when I try to run from user's cron tab its... (3 Replies)
Discussion started by: Tuxidow
3 Replies

7. UNIX for Dummies Questions & Answers

Cronjob not working

Hi, I am trying to run a script through crontab but it doesn't run. The script sends an email of the logfile created.When I reun through command line it works perfectly but doesn't send any email through cron. There are othe jobs in cron wich runs perfectly. Please let me know if I am doing... (3 Replies)
Discussion started by: Rossdba
3 Replies

8. Shell Programming and Scripting

Cronjob not working as intended

I have a shell script that I have scheduled using cron using a command: 0 10 * * * /directory/Script.sh > /directory/log/output.log The script is scheduled to run at 10 AM everyday. The script executes but produces output files only with headers, no content is there. The script produces... (11 Replies)
Discussion started by: Palak Sharma
11 Replies

9. Shell Programming and Scripting

Cronjob is NOT working

Hi; Here is the output from crontab -l: 2,7,12,17,22,27,32,37,42,47,52,57 * * * * /var/tmp/gcsw/jmap_samples/jmap_script.sh > /var/tmp/gcsw/jmap_samples/histo_`date '+%Y%m%d%H%M'`.txtWhen I manually run the line: /var/tmp/gcsw/jmap_samples/jmap_script.sh >... (2 Replies)
Discussion started by: gc_sw
2 Replies

10. Shell Programming and Scripting

PHP cronjob not working but manual working

Hi, Can anyone help me on my PHP cron not working, but when i do the manual it work. # manual run working /usr/local/bin/php /root/dev/test.php # crontab not working 55 8 * * * /usr/local/bin/php /root/dev/test.php Thank in advances Regards, FSPalero Please use CODE tags as... (2 Replies)
Discussion started by: fspalero
2 Replies
nispopulate(1M) 					  System Administration Commands					   nispopulate(1M)

NAME
nispopulate - populate the NIS+ tables in a NIS+ domain SYNOPSIS
/usr/lib/nis/nispopulate -Y [-x] [-f] [-n] [-u] [-v] [-S 0 | 2] [ -l <network_passwd>] [ -d <NIS+_domain>] -h <NIS_server_host> [ -a <NIS_server_addr>] -y <NIS_domain> [table] ... /usr/lib/nis/nispopulate -F [-x] [-f] [-u] [-v] [-S 0 | 2] [ -d <NIS+_domain>] [ -l <network_passwd>] [ -p <directory_path>] [table] ... /usr/lib/nis/nispopulate -C [-x] [-f] [-v] [ -d <NIS+_domain>] [ -l <network_passwd>] [hosts | passwd] DESCRIPTION
The nispopulate shell script can be used to populate NIS+ tables in a specified domain from their corresponding files or NIS maps. nispop- ulate assumes that the tables have been created either through nisserver(1M) or nissetup(1M). The table argument accepts standard names that are used in the administration of Solaris systems and non-standard key-value type tables. See nisaddent(1M) for more information on key-value type tables. If the table argument is not specified, nispopulate will automatically populate each of the standard tables. These standard (default) tables are: auto_master, auto_home, ethers, group, hosts, ipnodes, net- works, passwd, protocols, services, rpc, netmasks, bootparams, netgroup, aliases and shadow. Note that the shadow table is only used when populating from files. The non-standard tables that nispopulate accepts are those of key-value type. These tables must first be created manually with the nistbladm(1) command. Use the first synopsis (-Y) to populate NIS+ tables from NIS maps. nispopulate uses ypxfr(1M) to transfer the NIS maps from the NIS servers to the /var/yp/<NIS_domain> directory on the local machine. Then, it uses these files as the input source. Note that <NIS_domain> is case sensitive. Make sure there is enough disk space for that directory. Use the second synopsis (-F) to populate NIS+ tables from local files. nispopulate will use those files that match the table name as input sources in the current working directory or in the specified directory. Note that when populating the hosts, ipnodes, and passwd tables, nispopulate will automatically create the NIS+ credentials for all users and hosts (ipnodes) that are defined in the hosts, ipnodes, and passwd tables, respectively. A network passwd is required to create these credentials. This network password is used to encrypt the secret key for the new users and hosts. This password can be specified using the -l option or it will use the default password, "nisplus". nispopulate will not overwrite any existing credential entries in the credential table. Use nisclient(1M) to over- write the entries in the cred table. It creates both LOCAL and DES credentials for users, and only DES credentials for hosts. To disable automatic credential creation, specify the "-S 0" option. The third synopsis (-C) is used to populate NIS+ credential table with level 2 authentication (DES) from the hosts, ipnodes and passwd tables of the specified domain. The valid table arguments for this operation are hosts, ipnodes and passwd. If this argument is not spec- ified then it will use hosts, ipnodes and passwd as the input source. If other authentication mechanisms are configured using nisauth- conf(1M), the NIS+ credential table will be loaded with credentials for those mechanisms. If nispopulate was earlier used with "-S 0" option, then no credentials were added for the hosts or the users. If later the site decides to add credentials for all users and hosts, then this (-C) option can be used to add credentials. OPTIONS
-a <NIS_server_addr> Specifies the IP address for the NIS server. This option is only used with the -Y option. -C Populate the NIS+ credential table from hosts, ipnodes, and passwd tables using DES authentication (security level 2). If other authentication mechanisms are configured using nisauthconf(1M), the NIS+ credential table will be pop- ulated with credentials for those mechanisms. -d <NIS+_domain.> Specifies the NIS+ domain. The default is the local domain. -F Populates NIS+ tables from files. -f Forces the script to populate the NIS+ tables without prompting for confirmation. -h <NIS_server_host> Specifies the NIS server hostname from where the NIS maps are copied from. This is only used with the -Y option. This hostname must be present in the NIS+ hosts or ipnodes table, or in the /etc/hosts or /etc/inet/ipnodes file. If the hostname is not defined, the script will prompt you for its IP address, or you can use the -a option to specify the address manually. -l <network_passwd> Specifies the network password for populating the NIS+ credential table. This is only used when you are populating the hosts, ipnodes, and passwd tables. The default passwd is "nisplus". -n Does not overwrite local NIS maps in /var/yp/<NISdomain> directory if they already exist. The default is to over- write the existing NIS maps in the local /var/yp/<NISdomain> directory. This is only used with the -Y option. -p <directory_path> Specifies the directory where the files are stored. This is only used with the -F option. The default is the cur- rent working directory. -S 0|2 Specifies the authentication level for the NIS+ clients. Level 0 is for unauthenticated clients and no credentials will be created for users and hosts in the specified domain. Level 2 is for authenticated (DES) clients and DES credentials will be created for users and hosts in the specified domain. The default is to set up with level 2 authentication (DES). There is no need to run nispopulate with -C for level 0 authentication. Also, if other authentication mechanisms are configured with nisauthconf(1M), credentials for those mechanisms will also be popu- lated for the NIS+ clients. -u Updates the NIS+ tables (ie., adds, deletes, modifies) from either files or NIS maps. This option should be used to bring an NIS+ table up to date when there are only a small number of changes. The default is to add to the NIS+ tables without deleting any existing entries. Also, see the -n option for updating NIS+ tables from existing maps in the /var/yp directory. -v Runs the script in verbose mode. -x Turns the "echo" mode on. The script just prints the commands that it would have executed. Note that the commands are not actually executed. The default is off. -Y Populate the NIS+ tables from NIS maps. -y <NIS_domain> Specifies the NIS domain to copy the NIS maps from. This is only used with the -Y option. The default domainname is the same as the local domainname. EXAMPLES
Example 1: Using nispopulate To populate all the NIS+ standard tables in the domain xyz.sun.com. from NIS maps of the yp.sun.COM domain as input source where host yp_host is a YP server of yp.sun.COM: nis_server# /usr/lib/nis/nispopulate -Y -y yp.sun.COM -h yp_host -d xyz.sun.com. To update all of the NIS+ standard tables from the same NIS domain and hosts shown above: nis_server# /usr/lib/nis/nispopulate -Y -u -y yp.sun.COM -h yp_host -d xyz.sun.com. To populate the hosts table in domain xyz.sun.com. from the hosts file in the /var/nis/files directory and using "somepasswd" as the network password for key encryption: nis_server# /usr/lib/nis/nispopulate -F -p /var/nis/files -l somepasswd hosts To populate the passwd table in domain xyz.sun.com. from the passwd file in the /var/nis/files directory without automatically creating the NIS+ credentials: nis_server# /usr/lib/nis/nispopulate -F -p /var/nis/files -d xys.sun.com. -S 0 passwd To populate the credential table in domain xyz.sun.com. for all users defined in the passwd table. nis_server# /usr/lib/nis/nispopulate -C -d xys.sun.com. passwd To create and populate a non-standard key-value type NIS+ table, "private", from the file /var/nis/files/private: (nispopulate assumes that the private.org_dirkey-value type table has already been created). nis_server# /usr/bin/nistbladm -D access=og=rmcd,nw=r -c private key=S,nogw= value=,nogw= private.org.dir nis_server# /usr/lib/nis/nispopulate -F -p /var/nis/files private ENVIRONMENT VARIABLES
nispopulate normally creates temporary files in the directory /tmp. You may specify another directory by setting the environment variable TMPDIR to your chosen directory. If TMPDIR is not a valid directory, then nispopulate will use /tmp). FILES
/etc/inet/hosts local host name database /etc/inet/ipnodes local database associating names of nodes with IP addresses /var/yp NIS (YP) domain directory /var/nis NIS+ domain directory /tmp ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWnisu | +-----------------------------+-----------------------------+ SEE ALSO
nis+(1), nistbladm(1), nisaddcred(1M), nisaddent(1M), nisauthconf(1M), nisclient( 1M), nisserver(1M), nissetup(1M), rpc.nisd(1M), ypxfr(1M), attributes(5) NOTES
NIS+ might not be supported in future releases of the SolarisTM Operating Environment. Tools to aid the migration from NIS+ to LDAP are available in the Solaris 9 operating environment. For more information, visit http://www.sun.com/directory/nisplus/transition.html. SunOS 5.10 12 Dec 2001 nispopulate(1M)
All times are GMT -4. The time now is 09:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy