Files availability with count in email


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Files availability with count in email
# 1  
Old 11-07-2017
Files availability with count in email

Hi all,

we have a requirement , we need to check the files availability in the unix folder and their record counts need to be emailed as attached format

Code:
Files	Count
File_1	123
File_2	1898
File_3	29
File_4	456
File_5	123

Files availability with count in email-emailjpg

Last edited by jim mcnamara; 11-07-2017 at 06:38 AM..
# 2  
Old 11-07-2017
Welcome KK230689,

I have a few to questions pose in response first:-
  • Is this homework/assignment? There are specific forums for these.
  • What have you tried so far?
  • What output/errors do you get?
  • What OS and version are you using?
  • What are your preferred tools? (C, shell, perl, awk, etc.)
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)
Most importantly, What have you tried so far?

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.


We're all here to learn and getting the relevant information will help us all.



Kind regards,
Robin
# 3  
Old 11-07-2017
Several points

I'm going to assume linux/bash, but you should tell us your OS and shell.
This command gives you the file name:
Code:
cd /path/to/files/I/want
stat -c "%n %s" $( find . -type f -name 'Files*' ) > /tmp/file.txt

Now you can search the forums here for how to send an email attachment using /tmp/file.txt. The idea is to get you to be somewhat self-sufficient, able to help yourself.

We are here to help you, but not write code for you. Show us what you have tried once you locate the command you need. If you need help scheduling the new script we can help with that as well.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Email Server High Availability

Hello, We are planning to setup a Email server with High Availability for email services so that if SMTP/POP/IMAP goes down on one server, the services switch to second server. We are planning to use a Linux machines from a hosting provider and will do it using DNS with multiple MX records with... (0 Replies)
Discussion started by: sunnysthakur
0 Replies

2. Shell Programming and Scripting

Shell script for field wise record count for different Files .csv files

Hi, Very good wishes to all! Please help to provide the shell script for generating the record counts in filed wise from the .csv file My question: Source file: Field1 Field2 Field3 abc 12f sLm 1234 hjd 12d Hyd 34 Chn My target file should generate the .csv file with the... (14 Replies)
Discussion started by: Kirands
14 Replies

3. Shell Programming and Scripting

Error files count while coping files from source to destination locaton as well count success full

hi All, Any one answer my requirement. I have source location src_dir="/home/oracle/arun/IRMS-CM" My Target location dest_dir="/home/oracle/arun/LiveLink/IRMS-CM/$dc/$pc/$ct" my source text files check with below example.text file content $fn "\t" $dc "\t" $pc "\t" ... (3 Replies)
Discussion started by: sravanreddy
3 Replies

4. Shell Programming and Scripting

Script to send email if count is >1

i have below code to count number of rows in file1.txt, if the row count is more than one then i have sending an email along with file1.txt attached and fail the process(do nothing if count is <=1), if I test individually count part works good but when i include the email part its not working,... (4 Replies)
Discussion started by: srini_106
4 Replies

5. Shell Programming and Scripting

Send email based on row count

i have below code to count number of rows in file1.txt, if the row count is more than one then i have sending an email along with file1.txt attached and fail the process(do nothing if count is <=1), if I test individually count part works good but when i include the email part its not working,... (1 Reply)
Discussion started by: srini_106
1 Replies

6. UNIX for Dummies Questions & Answers

For loop to check the files availability

Hi, I need a help with my script. Below is my script. What I am doing here is finding the date of the file which I need to process and then finding the list of file names. Based on the list of file names, check has to be done to see if all the files are there and log the details to a error... (3 Replies)
Discussion started by: Vijay81
3 Replies

7. Shell Programming and Scripting

Script should keep checking for availability of files.

Hi, I want my script to check for availability of few files contineously for some time. Lets say from 10:00 AM to 10:30 AM script should keep checking on a particular location for each file one by one. If all the files are available then only it should complete the next processing part, else... (2 Replies)
Discussion started by: amit.mathur08
2 Replies

8. UNIX for Dummies Questions & Answers

Count number of files in directory excluding existing files

Hi, Please let me know how to find out number of files in a directory excluding existing files..The existing file format will be unknown..each time.. Thanks (3 Replies)
Discussion started by: ammu
3 Replies

9. Shell Programming and Scripting

Count todays created files and old files

Hello experts, I used following approach to get listing of all files of remote server. Now I have remote server file information on same server. I am getting listing in the output.txt I want to count today's created files and old files. I want to compare the numbers... (11 Replies)
Discussion started by: dipeshvshah
11 Replies
Login or Register to Ask a Question