Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Cron entry to pass the value to script Post 303038630 by bhartiya007 on Monday 9th of September 2019 06:02:58 AM
Old 09-09-2019
Cron entry to pass the value to script

0


I have a script(main.sh) which calls another script(Get_Files.sh) and gets a value in a variable like the below:

Code:
File_to_Refresh="$(sh /Aug/work/Get_Files.sh /Aug/Work/Universal_File.txt)"

Now I have to schedule the script main.sh for 3 different files i.e. the Universal_File.txt with 3 different values and on 3 different days.

So, to make the script generic, I want to pass the Universal file to Get_Files.sh from the Cron Entry only.

How Can i achieve the same?

Below is working if I run the script manually like sh /Aug/Work/main.sh /Aug/Work/Universal_File.txt but it's not working when i run it through cron.

Code:
File_to_Refresh="$(sh /Aug/work/Get_Files.sh "$1")"

Cron :

Code:
45 08 * * * sh /Aug/Work/main.sh /Aug/Work/Universal_File.txt

 

10 More Discussions You Might Find Interesting

1. AIX

Cron entry

Hi All, I want to run a cron job to run on the first saturday of each month at 1:30am. Would the following entry suffice this condition 30 1 6 * 6 wall %Will this work% Appreciate your time. (1 Reply)
Discussion started by: rramanuj
1 Replies

2. UNIX for Dummies Questions & Answers

cron entry

Hi, Where can we find Cron job logs?i have a cron job which is not executing at all, 00 12 * * * /xx/yy/job > /pp/qq/log if i execute the job alone,it is executing fine. >/xx/yy/job > /pp/qq/log (is executing fine) but its not executing when it triggered from cron.is there any place cron... (7 Replies)
Discussion started by: rujus
7 Replies

3. Shell Programming and Scripting

Cron Entry

Hi folks, I have got the following cron entry ... 08 30 * * * /mp1/scripts/test.sh > /mp1/scripts/test_logs.txt 2>&1 The problem is that instead of generating a new test_logs.txt file every time it keeps on appending the outputs to the test_logs.txt file. What is it that I am doing wrong... (2 Replies)
Discussion started by: King Nothing
2 Replies

4. Solaris

User entry in both cron.allow and cron.deny

Hello All, Anybody please help me to know ,what happens when a user having entry in both cron.allow and cron.deny files.Wheather the user will be able to access the crontab??? Thanks in advance Vaisakh (5 Replies)
Discussion started by: ksvaisakh
5 Replies

5. UNIX for Advanced & Expert Users

cron entry

Hi, I need some clarification on cron entries. I have a cron job like.. 15 01 19 02 6 exec /usr/bin/test.ksh and I have another cron entry added, which is 15 01 20 02 6 exec /usr/bin/test.ksh So, I am thinking the second cron entry shouldn't have run because 02/20 is Sunday, but... (1 Reply)
Discussion started by: everurs789
1 Replies

6. Shell Programming and Scripting

get system date, format it, pass it as a parameter to a perl script - all in cron job

I am trying to get the string containing date - in a specfic format actually, although I think that part is inconsequencial - 1110226^1110226^1110226^1110226^1110226 - through echo or printf or in some other way - created within a cront job and passed as a parameter to a perl script. Now, I know... (3 Replies)
Discussion started by: v8625
3 Replies

7. Solaris

cron entry

Hi, I have to add two cron entry now. Please correct me if anything wrong Below script should run at every one and half hour. 30 01 * * * /export/home/gxadm/scripts/collect_mq_info.pl $HOME/GCSS/logs > /dev/null 2>&1 Below script should run at every 2 hours 0 02 * * *... (9 Replies)
Discussion started by: Mani_apr08
9 Replies

8. Shell Programming and Scripting

Commenting out a cron entry through a shell script

In my cron thare is a line like 24 11 * * * /usr/batch/bin/abc.sh > /usr/batch/log/abc.log 2>&1 along with other entries. I want to comment out this line through a shell script. My local variable 'line'ontains the full entry (i.e. 24 11 * * * /usr/batch/bin/abc.sh > /usr/batch/log/abc.log... (4 Replies)
Discussion started by: Soham
4 Replies

9. 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

10. Solaris

Cron entry

Hi I have a system running solaris 11, in which I am able to execute a script from the command line, but once I put i the crontab does run, but do not give results. The entry is: 15 11 * * * /var/oswbb/./startOSWbb.sh >> myjob.log 2>&1 30 11 * * * /var/oswbb/./stopOSWbb.sh I have check... (2 Replies)
Discussion started by: fretagi
2 Replies
VMWARE-XFERLOGS(1)						   Open VM Tools						VMWARE-XFERLOGS(1)

NAME
vmware-xferlogs - dump vm-support output to vmx logfile SYNOPSIS
vmware-xferlogs OPTIONS FILE DESCRIPTION
vmware-xferlogs is a simple console application and can be run as any user. It is based on rpctool to dump the vm-support output to the vmx log file base64 encoded. It can dump any file supplied on the commandline to the vmx log. It also does the decoding part of it. It can read the vmware.log file decode and write the encoded files in the directory it was invoked. Example of a transfer found in the vmx log file: Aug 24 18:48:09: vcpu-0| Guest: >Logfile Begins : /root/install.log: ver - 1 Aug 24 18:48:09: vcpu-0| Guest: >SW5zdGFs- bGluZyA0NDEgcGFja2FnZXMKCkluc3RhbGxpbmcgZ2xpYmMtY29tbW9uLTIuMi41LTM0 Aug 24 18:48:09: vcpu-0| Guest: >LgpJbnN0YWx- saW5nIGh3ZGF0YS0wLjE0LTEuCkluc3RhbGxpbmcgaW5kZXhodG1sLTcuMy0zLgpJ Aug 24 18:48:09: vcpu-0| Guest: >bnN0YWxsaW5nIG1haWxjYXAtMi4xLjk- tMi4KSW5zdGFsbGluZyBtYW4tcGFnZXMtMS40OC0yLgpJ .... .... Aug 24 18:48:10: vcpu-0| Guest: >Mi4K Aug 24 18:48:10: vcpu-0| Guest: >Logfile Ends OPTIONS
enc dec SEE ALSO
vmware-checkvm(1) vmware-hgfsclient(1) vmware-toolbox(1) vmware-toolbox-cmd(1) vmware-user(1) libguestlib(3) libvmtools(3) vmware-guestd(8) vmware-hgfsmounter(8) vmware-user-suid-wrapper(8) vmblock(9) vmci(9) vmhgfs(9) vmmemctl(9) vmsock(9) vmsync(9) vmxnet(9) vmxnet3(9) HOMEPAGE
More information about vmware-xferlogs and the Open VM Tools can be found at <http://open-vm-tools.sourceforge.net/>. AUTHOR
Open VM Tools were written by VMware, Inc. <http://www.vmware.com/>. This manual page was put together from homepage materials by Daniel Baumann <daniel.baumann@progress-technologies.net>, for the Debian project (but may be used by others). 2010.03.20-243334 2010-04-08 VMWARE-XFERLOGS(1)
All times are GMT -4. The time now is 10:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy