log file remains empty


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting log file remains empty
# 1  
Old 06-13-2011
log file remains empty

Hi

I'm not sure if I'm in the right section of the forum, but I hope someone can help me anyway. I'm logged onto my university server via ssh and execute a perl script. The output should be written into a log file.

I run the script like this:

perl scripts/test.pl scripts/Config.pm > log 2>&1 &

When I run it in my home directory without ssh, it works perfectly and I get the output plus error messages written into the log file. But when I'm logged in on the uni server and run the command, the log file remains empty. Sometimes it doesn't, but most of the times it is the case. When I look at the ongoing processes with the top command, I can see that the programme is running, but why do I have problems getting the output into the log file?

Thanks,

Kat
# 2  
Old 06-13-2011
<DELETED>

Last edited by yazu; 06-13-2011 at 09:32 AM.. Reason: Wrong information
# 3  
Old 06-13-2011
I think after SSH the user account won't have permission to write on the existing script server, where your log path is. Please check it out.
You can do, output of SSH write in the remote server and do a scp to the local server. Please comment if you have better idea.

Thanks
# 4  
Old 06-13-2011
Thanks. The file permissions are -rw-r--r-- and I'm the owner of the file, so I should be able to write into it?

I'm a newbie to unix, can you please explain how I write the output to my local server, or where I can find an instruction for that?
# 5  
Old 06-14-2011
As you are doing the ssh , Even though you have the permission upon the file, the remote account user won't have that permission. Please give write permission to that file for "others".
# 6  
Old 06-14-2011
I changed the permissions, but still the log remains empty!
# 7  
Old 06-14-2011
Hi,

For running script in remote machine i suppose by default the file should have permission if you have created script with same user and the place where u are trying to write log file (default this will go to local server)

see the below sample i just tested.

Code:
serverA$ ssh user@serverB perl /home/location/test.pl  > /serverA/home/test.log
serverA$ more test.log
Hello world

HOpe this helps you..

Thanks
Sha
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk to reformat output if input file is empty, but not if file has data in it

The below awk improved bu @MadeInGermany, works great as long as the input file has data in it in the below format: input chrX 25031028 25031925 chrX:25031028-25031925 ARX 631 18 chrX 25031028 25031925 chrX:25031028-25031925 ARX 632 14... (3 Replies)
Discussion started by: cmccabe
3 Replies

2. Cybersecurity

/var/log/secure* mysteriously empty!

Hello everyone. I'm a newbie and this is my first post, and I'm hoping to get some help understanding what happened on my server. I did as much research as I could, but now I turn to the forums for help :) I've set up a VPS server and I "thought" I had good enough security on it, but all of a... (2 Replies)
Discussion started by: antondev
2 Replies

3. UNIX for Advanced & Expert Users

How to export ENV variables, which remains set for all the shell

Hi ! How to export ENV variables, which remains set for all the shell Example :- Login :myID Pwd : **** -> Here my ID .profile is executed. Let say I set MYENV variable Kisses% rlogin ABC -l XXXGroupID -> I login into a remote Solaris Server ABC password : **** -> "XXXGroupID's... (1 Reply)
Discussion started by: dashok.83
1 Replies

4. UNIX for Dummies Questions & Answers

Getting same exit status for empty and non empty file

Hi All, I am checking for a empty input file to do some further action , but I am getting exit status 0 in both the cases , for empty and non empty file both. The value of $? is coming 0 in if part also and else part too. #!/bin/ksh if ]; then echo "data" # exit 0 echo "$?" else... (4 Replies)
Discussion started by: mavesum
4 Replies

5. Shell Programming and Scripting

Shell script using ssh remains connected at primary site

Hi All, OS:AIX 5.3 L My shell script using ssh remains connected at primary site and ssh doesn't get disconnected.What should be typed and where in the shell script below to do it. Shell script ======== #!/usr/bin/ksh v_standby=`sqlplus -s /nolog <<END @standby.sql END` echo... (5 Replies)
Discussion started by: a1_win
5 Replies

6. Shell Programming and Scripting

Shell script process remains after "exit 1"

I have a script that performs an oracle export: <snip> if then exp / full=y file=${exp_file} log=${exp_log} direct=y feedback=1000000 STATISTICS=NONE buffer=20000000 else exp / full=n owner=${schema_name} file=${exp_file} log=${exp_log} direct=y feedback=1000000... (4 Replies)
Discussion started by: Squeakygoose
4 Replies

7. Shell Programming and Scripting

how to see if the file is empty or not?

hi how can I determine, if a file is empty or not?I am using read line clause. The script should be like: while read line do if(file is empty) then; ...... done < $blacklist (1 Reply)
Discussion started by: tjay83
1 Replies

8. UNIX for Dummies Questions & Answers

Trying to empty file using > but the file size increasing when next append

AIX 5.3 / KSH I have a Java application which creates a log file a.log. I have a KSH script which does the following action cp a.log /directory2/b.log > a.log After this the file size goes to 0 as per "ls -l" Then next time when the application writes into this file, the file size... (4 Replies)
Discussion started by: firdousamir
4 Replies

9. Shell Programming and Scripting

File is not empty?

How do I check to make sure a file is not zero bytes? Something like: if then ????? (7 Replies)
Discussion started by: lesstjm
7 Replies

10. UNIX for Dummies Questions & Answers

screen remains dark when box is on

I am somewhat new to UNIX. I inherited a sun ULTRA 5 box from my cousin. When I turn it on it seems to be working alright but I can't get a picture on the screen. The sound output from the CD player is working. The machine seems to be working but the only thing missing is the picture. When I... (4 Replies)
Discussion started by: ted
4 Replies
Login or Register to Ask a Question