customised error message..


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting customised error message..
# 1  
Old 10-24-2011
Data customised error message..

Hi,
Below is the script that takes some value from the properties file and then move the file from files folder to output folder based upon the modification time of files(configurable N days value),now at the end I want to show a customised message that if no files are moved then it shows the customised error message saying that there are no files to be moved and if it moves the file then after moving the files, it should show a customised error message saying that files are moved ..Please guide me on that...?

below is the structure of the script file...

Code:
#!/bin/sh 

#. /home/Administrator/scripts/archieve1.config

#echo $SrcDirectory
awk -F = '/Days=/{days=$2}/SrcDirectory=/{src=$2}/DestDirectory=/{dest=$2}END{print days, src, dest}' \
archieve1.config |while read DAYS INDIR OUTDIR
do 
   find $INDIR -type f -mtime -$DAYS -exec mv {} $OUTDIR \;
done

Smilie

Last edited by vbe; 10-24-2011 at 11:26 AM..
# 2  
Old 10-24-2011
Since you are using find... What happens when no file match the criteria?

This should help you on how to continue
You give it a try and tell us what you see and if its inspiring you
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Red Hat

Customised Output

I want some customised output of following command: $ls -a|sort gives output as filenames line by line. But I want the output as filenames aeperated by tab? How can I get this? Thanks in advance. (7 Replies)
Discussion started by: ashok.g
7 Replies

2. UNIX for Dummies Questions & Answers

Error Message

I am getting a error message when I try to assign this? Can someone help I am new to unix? $ First-name=james ksh:First-Name=james not found (1 Reply)
Discussion started by: vthokiefan
1 Replies

3. UNIX for Dummies Questions & Answers

Error message: What does it mean?

I get this error message in my maillog. Can someone tell me what it means? SYSERR(root): collect: I/O error on connection from mail-05.goomba.com I guess it means that the server could not connect to mail-06.goomba.com. Is my interpretation correct? Any idea why it happens? (1 Reply)
Discussion started by: mojoman
1 Replies

4. Red Hat

running customised firewall -RHEL 4

I have created a custom firewall script in RHEL 4 .Let me explain the steps which i followed . etho -Internal lan eth1 -External lan During the installtion of RHEL 4 ,i enabled Firewall and after booting to x windows i selected enable firewall and defined the defined and customised ports... (0 Replies)
Discussion started by: sud.tech
0 Replies

5. UNIX for Dummies Questions & Answers

Error Message

I keep getting an error message in a script im writing, this line is allways pointed out. if and this is the message i keep getting. line 32: [: 8: unary operator expected Whats wrong with it? Please Help. (5 Replies)
Discussion started by: chapmana
5 Replies

6. UNIX for Dummies Questions & Answers

Error Message

What does this means? - ERROR OPENING FILE - KEY LENGHT MISMATCH (2 Replies)
Discussion started by: RDM00
2 Replies

7. UNIX for Dummies Questions & Answers

customised filename

Hi, I am taking an output and redirecting it to a file name and this is a hourly or daily process , in this case, i want my file output as some logoutput_date_time.txt how can i form the file name like this for eg i am running this command now, so tail -f... (1 Reply)
Discussion started by: vasikaran
1 Replies

8. UNIX for Dummies Questions & Answers

Error Message

Hi everyone, Can anyone explain what the following error refers to...and perhaps a solution? vxfs: vx_nospace -/tmp file system full (8 block extent) Thanks, Uni (2 Replies)
Discussion started by: Uni
2 Replies

9. UNIX for Dummies Questions & Answers

customised functions...

I am going to build some commands/functions for common tasks that I have to perform (things like searching a filesystem for a certain string in a file). I intend to write these as unix scripts. Then adding the location of these to my path. How can I ensure that the variables specified when... (7 Replies)
Discussion started by: peter.herlihy
7 Replies
Login or Register to Ask a Question