Visit Our UNIX and Linux User Community


Ask Step create crontab


 
Thread Tools Search this Thread
Operating Systems AIX Ask Step create crontab
# 8  
Old 09-16-2013
Code:
 >> <directory>

apparently tries odd things.
Try
Code:
45 14 * * * <my directory>/myfile

and do the >> in myfile
# 9  
Old 09-16-2013
Quote:
Originally Posted by ibmtech
To Williamen
"that is not work,
errpt is command,"

Those statements right there are not correct, it works I tried it, what you are doing is appending the errpt o/p to that file everyday at 2:45 PM.

On your script (myfile), have you check the permissions and ownership? change the file permission to 744 (read, write &execute for the owner)

I have tried the below and its working for me
Code:
ls -l /tmp/myfile
-rwxr--r--    1 root     system           22 Sep 16 10:17 /tmp/myfile
# cat /tmp/myfile
errpt >> /tmp/err1

I have tried using '-a' flag for errpt as well, and in both cases its appending.
Code:
18 10 * * * /tmp/myfile 2>&1

Code:
-rw-r--r--    1 root     system        82952 Sep 16 10:18 /tmp/err1

, look at the time stamp on file
Code:
cat /tmp/err1
BFE4C025   0901075913 P H sysplanar0     UNDETERMINED ERROR
BFE4C025   0901075813 P H sysplanar0     UNDETERMINED ERROR
BFE4C025   0901075813 P H sysplanar0     UNDETERMINED ERROR
BFE4C025   0901075713 P H sysplanar0     UNDETERMINED ERROR
BFE4C025   0901075713 P H sysplanar0     UNDETERMINED ERROR
BFE4C025   0901075613 P H sysplanar0     UNDETERMINED ERROR
BFE4C025   0901075513 P H sysplanar0     UNDETERMINED ERROR
A6DF45AA   0901074413 I O RMCdaemon      The daemon is started.
BFE4C025   0901074113 P H sysplanar0     UNDETERMINED ERROR
BFE4C025   0901074113 P H sysplanar0     UNDETERMINED ERROR
BFE4C025   0901074113 P H sysplanar0     UNDETERMINED ERROR

I have pasted the partial ouput.

Mr IbmTech.

I trying your command, but not work at my system,

this I trying,
1. I create file
Code:
#pwd
/amin
#touch myfile
#cat myfile
errpt -a >> logerSBX

#ls -l
-rwxr--r--    1 root     system           58 Sep 17 09:16 myfile

I give a permition 744 same with you,

2. add to crontab
Code:
#crontab -e
* * * * * /amin/myfile 2>&1

and I open my directory amin, not have a file
Code:
#pwd
/amin
#ls 
myfile

and, I trying execute the myfile,
Code:
#./myfile
#ls -l
total 112
-rw-r--r--    1 root     system        50540 Sep 17 09:44 logerSBX
-rwxr--r--    1 root     system           64 Sep 17 09:43 myfile

not have a execute the crontab,
Code:
#ps -ef | grep cron
# ps -ef | grep cron
    root 2359532       1   0   Aug 30      -  0:16 /usr/sbin/cron
    root 2490518 2491230   0 09:29:12  pts/4  0:00 vi /tmp/crontabT-aRUa
    root 2949350 3408094   0 15:25:07  pts/4  0:00 crontab -e
    root 3145756 3408094   0 15:24:00  pts/4  0:00 vi /var/adm/cron/at.deny
    root 3539098 2818598   0   Sep 13  pts/1  0:00 vi /tmp/crontabNLa9ya
    root 1835462 2294258   0 09:30:09  pts/4  0:00 vi /tmp/crontabqPa6ia

have a idea again mr ?

regard

Last edited by williamen; 09-16-2013 at 11:46 PM.. Reason: Code tags, please...
# 10  
Old 09-17-2013
Quote:
Originally Posted by williamen
Mr IbmTech.

I trying your command, but not work at my system,

this I trying,
1. I create file
Code:
#pwd
/amin
#touch myfile
#cat myfile
errpt -a >> logerSBX

#ls -l
-rwxr--r--    1 root     system           58 Sep 17 09:16 myfile

I give a permition 744 same with you,

2. add to crontab
Code:
#crontab -e
* * * * * /amin/myfile 2>&1

and I open my directory amin, not have a file
Code:
#pwd
/amin
#ls 
myfile

You did not followed what I mentioned, you added your own flavor and complaining its messed up, wait a minute, roll back, take a deep breath and look at it again.

I bet, you din't read my post thoroughly.

In the file 'myfile', where are you pointing the logerSBX log file? you are not directing it under /amin, but instead to user's home directory, and you are looking under '/amin' directory, how can you find it?
Secondly, try to go easy, 1st use a specific time for crontab to run the job.
Say you are working on it at 9am, use 9 10 (10 minutes after 9 am) as crontab entry for the job.
# 11  
Old 09-18-2013
dear IBMtech,

I trying your command work,
but use with time at crontab.

Ok, thank you master,



regard
# 12  
Old 09-18-2013
Quote:
Originally Posted by williamen
dear IBMtech,

I trying your command work,
but use with time at crontab.

Ok, thank you master,



regard

I literally did not understand what you mean by that.
# 13  
Old 09-20-2013
Quote:
Originally Posted by ibmtech
You did not followed what I mentioned, you added your own flavor and complaining its messed up, wait a minute, roll back, take a deep breath and look at it again.

I bet, you din't read my post thoroughly.

In the file 'myfile', where are you pointing the logerSBX log file? you are not directing it under /amin, but instead to user's home directory, and you are looking under '/amin' directory, how can you find it?
Secondly, try to go easy, 1st use a specific time for crontab to run the job.
Say you are working on it at 9am, use 9 10 (10 minutes after 9 am) as crontab entry for the job.
sir,

If I trying your post status work..
and running at /tmp

if I change positions /amin yor command not work.

maybe you can explain me..


regard,
# 14  
Old 09-20-2013
Check to see if '/amin' directory exist? if it does exist make sure you have it at right place (say you want to create '/amin', make sure its under '/' and not under any other sub directory). Also make sure you are point the output to correct location.

Lastly, check the ownership of the directory and its files? If it doesn't belong to you change the ownership.

Previous Thread | Next Thread
Test Your Knowledge in Computers #450
Difficulty: Medium
In 2016, the Linux Mint website was compromised by unknown hackers, who briefly replaced download links for a version of Linux Mint with a modified version that contained malware.
True or False?

8 More Discussions You Might Find Interesting

1. What is on Your Mind?

Slowly Removing Bold Font Style - Step-by-Step

FYI, I'm slowly removing a lot of the bold font-styles from titles of discussions, forum titles, etc I'm not removing bold for the entire site because we do need bold from time to time, especially in posts and sometimes in other places. However, the original forum style had way too much... (3 Replies)
Discussion started by: Neo
3 Replies

2. Solaris

step step apache2 configuration doc

Hi Guys, does anyone know of a step by step guide on how configure apache2 web server in solaris 10? I will really appreciate it. Thanks a lot (1 Reply)
Discussion started by: cjashu
1 Replies

3. UNIX for Advanced & Expert Users

Test shell script step by step?

Hi to all, I don't know if someone has done sometime a MS Excel Macro, that allows us to press F8 over the code to see step by step, to mention something, how is running the code, which values take the variables, if some loop is executing correct or where a error occurs, and some other... (7 Replies)
Discussion started by: Ophiuchus
7 Replies

4. Linux

May you explain step by step where and how I will add pseudo code

Thank all of you. May you explain step by step where and how I will add pseudo code Note : I have Linux 2.6.24-26-server on x86_64 dears kindly help me (3 Replies)
Discussion started by: nonowa
3 Replies

5. UNIX for Dummies Questions & Answers

looking for step by step emacs c++ debug tutorial

Hello all i was searching the net for simple but effective tutorial to show me how debug c++ in emacs with not much luck. im not new to unix but new to emacs , i looking for tutorial that shows how to debug ( if possible ) c++ programs . LIike IDE suppose to , break points step in/out variable... (0 Replies)
Discussion started by: umen
0 Replies

6. Shell Programming and Scripting

works step by step on command line but not in script

Hi all, The following script is fine when I work via command line m=1 c=0 while do echo $m gnokii --getsms IN $m > out.txt; m=`expr $m + 1`; cat out.txt >> message_log; ############ read first crap< <(sed -n '/Text:/{n;p;}' out.txt); read message< <(sed -n '/Text:/{n;p;}'... (2 Replies)
Discussion started by: whamchaxed
2 Replies

7. UNIX for Dummies Questions & Answers

Step by step Installation of Unix SCO 2.1

I am new to unix and server at my job crashed due to hardware problem. I'm now opted to install sco unix on a new server - could anybody help me with the steps I need to take (pretty old machine) Thanks & Regards Nancy :( (0 Replies)
Discussion started by: nensee7
0 Replies

8. UNIX for Dummies Questions & Answers

install of sco unix step by step

HI I am new to unix and need to install sco unix on a new server - could anybody help me with the steps I need to take - the hd is a 9gb scsi drive (pretty old machine) Thanks (1 Reply)
Discussion started by: porikamu
1 Replies

Featured Tech Videos