Results 1 to 5 of 5

Thread: Bash script needs to e-mail output

  1. #1
    Join Date
    Mar 2011
    Posts
    77

    Bash script needs to e-mail output

    Hello friend, last one week, I work on the bash Linux operating system. This OS is one of the type of the UNIX operating system. Yesterday, I work on a new backup script. This script puts the specific output. I want to email this script output. Actually I want some technique or code which helps to email this output to the previously set email address. The same kind of operations performs by the cron job. Can I do this? If anyone having knowledge about it then please share it. Any help will be appreciates.

  2. #2
    Join Date
    Nov 2009
    Posts
    1,340

    Re: Bash script needs to e-mail output

    There are no direct connections present in this bash script and the email. You need to first save the output to the backup utility such as files. Then send this file to the specific email address. This can be done by adding the code of both operations into the single script. This will helps to solve the trouble. This is indirect solutions of the trouble. I will explain just the overview of the solutions. You need to build that code. Then it helps you to solve the trouble.

  3. #3
    Join Date
    May 2008
    Posts
    540

    Re: Bash script needs to e-mail output

    Hey, I have done this kind of code. I will tel you that code instructions. First copy the output to one file. For doing this use the tar command. Then it helps to copy the output the file. Then use the sendmail command for sending the output to the other person. You can also use the other command mail -s and then put the file name for sending the mail. This is the best way to send the output file to the specific email address. Then use it and send mail of the script output.

  4. #4
    Join Date
    Nov 2009
    Posts
    712

    Re: Bash script needs to e-mail output

    There is no need to doing such kind of effort. There are already presents some kind of code. This code help to perform the operations. I tell you the code. Just use the pipe command of the bash Linux OS and this is so helpful to perform such kind of operations in the single line. In the prompt enter the bash script file execute command. Then insert the pipe symbol. Then immediately use the tee command the put the output to the text file. Then after that insert pipe symbol and enter the mail command. Finally just execute this single line code. This code will execute fast. Then in single line the script is executed, output is generated and then it sends to the email address.

  5. #5
    Join Date
    Nov 2009
    Posts
    624

    Re: Bash script needs to e-mail output

    If you want to perform these operations again and again then I suggest you to design the stored procedure code. The procedure concept is specially designed for performing this kind of complex operations reputedly. You need to define the procedure and in that procedure mention this four line code. Then store it into the system directory. It helps you to execute the code again and again. This will helps to solve the trouble.

Similar Threads

  1. How to create CGI script in bash?
    By Mulan in forum Software Development
    Replies: 5
    Last Post: 01-09-2010, 08:19 PM
  2. Linux bash script with the command w
    By Trini Alvarado in forum Operating Systems
    Replies: 4
    Last Post: 22-03-2010, 12:11 PM
  3. Create bash script for ftp
    By teenQ in forum Operating Systems
    Replies: 4
    Last Post: 04-03-2010, 07:37 PM
  4. Bash script if then else help
    By Unix'EM in forum Software Development
    Replies: 3
    Last Post: 18-08-2009, 06:34 PM
  5. Bash Script, read without new line
    By Kieran in forum Software Development
    Replies: 2
    Last Post: 06-02-2009, 09:59 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,556,864.46381 seconds with 16 queries