Sponsored Content
Top Forums Shell Programming and Scripting Script to create folder, copy file, and send email on success Post 302718337 by rdrtx1 on Friday 19th of October 2012 12:58:17 PM
Old 10-19-2012
Example script:
Code:
 
success=1
if [ ! -d /mnt/backup/$(date +%F) ]
then
  mkdir /mnt/backup/$(date +%F) || success=0
  #(create dated folder on destination [linux VM])
fi
if [ $success = 1 ]
then
  cp /mnt/FAS/etc/hosts /mnt/backup/$(date +%F) || success=0
  #(copy from my Netapp to the local VM file structure)
fi
if [ $success = 1 ]
then
  echo "copy success" | mailx -s "File copy success" minnino@minnino.server.com
else
  echo "copy failed" | mailx -s "File copy failed" minnino@minnino.server.com
fi


Last edited by rdrtx1; 10-19-2012 at 02:05 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to send a file in email

a file is created on a daily basis in the name xyz_pqr_20071207.dat.i want to send the file as an attachment if the file contains more than 50 records.how can i write a script such that it will transmit the file after the file is created.i want to sed the file to say asdf@xyz.com. please help me... (2 Replies)
Discussion started by: dr46014
2 Replies

2. Shell Programming and Scripting

Script to send email if new file is added when folder is updated

Hi, I have a script which updates a repository which is run manually. When this happens either no or new files will be added to a specific folder. If there are new files that have been added, an email needs to be sent. How can i check a folder for any new files after the update repos script has... (0 Replies)
Discussion started by: acc01
0 Replies

3. Shell Programming and Scripting

Script to send email after comparing the folder permissions to a certain permission & send email

Hello , I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them . I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies

4. UNIX for Advanced & Expert Users

send an email to my Drafts folder

Is there a way I can send a text file directly to my Drafts folder? (1 Reply)
Discussion started by: idontknow
1 Replies

5. Shell Programming and Scripting

how to avoid cron job output to send to the junk email folder?

Hi i created a cron job which invoke a shell script and output some content via email. Some times these output are sent to the junk email folder. i want these mails to be sent to inbox with some specific font. what i have to do? (4 Replies)
Discussion started by: vidhyaS
4 Replies

6. Shell Programming and Scripting

Shell script to send an email from the txt file

Hi Friends, Could you guys help me out of this problem... I need to send an email to all the users and the email has to be picked from the text file. text file contains the no. of records like: giridhar 224285 847333 giridhar276@gmail.com ramana 84849 33884 venkata.ramana@gmail.com... (6 Replies)
Discussion started by: giridhar276
6 Replies

7. Shell Programming and Scripting

Need help in writitng a script to rename file name and copy to other folder

Hi All, My requirement is as follows: A file (say abc) will be having list of the .txt file names. I need to read this abc file line by line and rename the .txt file names inside it and move them to other folder/path. Eg: abc ------- file1.txt file2.txt file3.txt Output (should... (1 Reply)
Discussion started by: pavan.yadalla
1 Replies

8. Shell Programming and Scripting

Bash for checking and copy Daily files and send an email

Hello, Trying to get a bash for files received on daily basis and want to copy those files to different directory and send an email notification if file exists then send the file counts else Alert with no file received. FileName format: DailyTransaction_2015-03-09_ 200.csv before 200 their is... (1 Reply)
Discussion started by: krux_rap
1 Replies

9. Shell Programming and Scripting

How to copy all structure folder create last day?

HI All, please help , i got same case . i want copy folder and directory create yesterday. for sample below : drwxr-xr-x 4 apps apps 33 Nov 23 04:00 xxxxxx@gmai.com drwxr-xr-x 4 apps apps 33 Nov 23 04:00 yyyyyyy@gmail.com drwxr-xr-x 4 apps apps 33 Nov 24 04:00... (2 Replies)
Discussion started by: fajar_3t3
2 Replies

10. UNIX for Beginners Questions & Answers

Shell script to execute Oracle procedure and trigerring email on success and failure

Here is the shell script which need to trigger a stored procedure and when the record count is 0 then it should capture in the log that 0 duplicate records are found and if it's more than 0 then log with no of records. Also if there is any sqlerror then it should write the same in the log file and... (17 Replies)
Discussion started by: senmng
17 Replies
rpdump(1)						      General Commands Manual							 rpdump(1)

NAME
rpdump - alpine remote data utility SYNTAX
rpdump [ -f ] -l Local_file -r Remote_folder DESCRIPTION
Rpdump may be used to copy the actual data from remote Alpine configuration files or address books into a local file. It is intended to be used by system administrators. Regular users should normally use the facilities provided within Alpine. Local_file will normally be a local temporary file. Remote_folder is the IMAP folder being used as a remote Alpine configuration (with the help of Alpine's -P, -p, and -x commands or PINECONF, PINERC, and PINERCEX environment variables) or remote Alpine address book folder. A copy of the data from Remote_folder will be copied to Local_file. -f Force the dump even if the remote folder is in an unrecognized format. -l Local_file The file on this system that is to be copied to. -r Remote_folder A remote folder name to be copied from. See the Alpine documentation for the syntax of a remote folder name. One example is {my.imap.server}remote_pinerc. DIAGNOSTICS
Exit status is zero if all goes well, -1 otherwise. SEE ALSO
Rpload(1). Copyright 1989-2007 by the University of Washington. $Date: 2005/01/14 20:40:14 $ rpdump(1)
All times are GMT -4. The time now is 02:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy