Creating Log files from Scripts


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Creating Log files from Scripts
# 1  
Old 04-29-2010
Creating Log files from Scripts

Hi

I would like to create a log file to track the execution of my script.
Example, if there were any errors, if it passed or failed etc.

How do I go about doing this.

My log file will be saved to this location: /var/log/import.log

How do I specify the directory?

I have been using something like this from another script but I don't understand it too well.

Code:
 
if [ -e ${dsxpids}$module.pid ] 
  then
  dsxlog $reverb --warning --module="$module" " pid = $$ : Is already   running"

  true;
else
  dsxlog $reverb --info --module="$module" "Now processing pid = $$"
fi

can u please help.

Thank u
# 2  
Old 04-29-2010
you should post the contents of the log file and tell us what action you want to take from those.

e.g what is the identification for pass, fail or error etc.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Help with creating script to delete log files/folders

Hi I am new to Linux / scripting language. I need to improve our Linux servers at work and looking to claim some space my deleting log files/ folders on a 5 day basis. Can someone help me with creating a script to do so. Any sample script will be helpful.:b: Regards (2 Replies)
Discussion started by: sachinksl
2 Replies

2. Shell Programming and Scripting

Help with creating startup scripts using screen

Edit: So sorry! I really didn't do a good job of clearly stating what I needed. Going to completely rewrite my post so everything is clearly stated. I'm having trouble writing a shell startup script for a linux server. It uses the bash shell if I remember correctly. I'm trying to write it so... (9 Replies)
Discussion started by: Pyitoechito
9 Replies

3. Shell Programming and Scripting

creating directory from scripts

Dear All, I have a shell scripts which create a directory and perform moving some files, when the script is kept where it is creating directory then it runs fine , but when the scripts is run where it is supposed to be which is different location then where i am creating directory , scripts... (2 Replies)
Discussion started by: guddu_12
2 Replies

4. UNIX Desktop Questions & Answers

creating an executable file from shell scripts

Hi Friends, I have a shell script which does some operations etc, would it be possible to create an executable file out from this shell script? meaning the executable file is not editable, thus the source code will not be visible to other users for copyright reasons. Please help, thanks! (1 Reply)
Discussion started by: kokoro
1 Replies

5. Shell Programming and Scripting

Need help creating a script to FTP files to a server and then delete the files that were transfered.

I am trying to FTP files to a Windows server through my Linux machine. I have setup the file transfer with no problems but am having problem deleting those files from the Linux box. My current non-working solution is below. Any ideas, anyone?? :wall: Please be gentle, I'm fairly new to this... (4 Replies)
Discussion started by: jmalfhs
4 Replies

6. Ubuntu

Problem creating Desktop shortcuts through Debian dpkg installer scripts

Hi, I am creating a debian package (*.deb) for my application using the command I am using debian pre/post installer scripts to do certain tasks before/after installation/uninstallation. One such task is to create a shortcut on the user's desktop to launch my application. I am trying to do this... (0 Replies)
Discussion started by: royalibrahim
0 Replies

7. Shell Programming and Scripting

creating scripts

Hello... First of all, as a new member, i found this forum very helpful and all the members have great knowledge. I am trying to learn unix online, as i have to make a script to monitor a solaris machine performance. I found UNIX not as hard as i thought but making scripts and printing it... (5 Replies)
Discussion started by: mohamedh_14
5 Replies

8. UNIX for Dummies Questions & Answers

creating new files

Hello , What is the easiest way to get into a directory in solaris and simply create a new file that you can then fill with content? Thanks (4 Replies)
Discussion started by: montana77
4 Replies

9. Shell Programming and Scripting

shell scripts that parse log files

hi all ,i would like a shell script that parses log files and checks the contents for any anonalities,please help,thanks (4 Replies)
Discussion started by: trueman82
4 Replies

10. Solaris

creating log files for a backup script on solaris

I have a simple backup script that I am running to back up drives across the network. However I need to have detailed log files for this script such as time backup started, what was backed up, if there were any errors and the time that the backup was complete. I would also like the script to... (3 Replies)
Discussion started by: valicon
3 Replies
Login or Register to Ask a Question