Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi Everyone I have a cron job setup to run a script which uploads daily backups to Amazon S3 via s3cmd. For some reason I receive about 75 emails while this script is running. Here is the script, any idea why it sends all of these emails?
#!/bin/bash
DIRECTORY="/var/www/backups/"
echo uploading to S3 with reduced redundancy...
/root/s3cmd/s3cmd put --recursive --rr $DIRECTORY/*.zip s3://backups/
echo Done uploading to s3, deleting files...
rm -rf $DIRECTORY/*.zip
echo Finished!
Hi Everyone I have a cron job setup to run a script which uploads daily backups to Amazon S3 via s3cmd. For some reason I receive about 75 emails while this script is running. Here is the script, any idea why it sends all of these emails?
Code:
#!/bin/bash
DIRECTORY="/var/www/backups/"
echo uploading to S3 with reduced redundancy...
/root/s3cmd/s3cmd put --recursive --rr $DIRECTORY/*.zip s3://backups/
echo Done uploading to s3, deleting files...
rm -rf $DIRECTORY/*.zip
echo Finished!
You don't tell us what the emails say, or how many files you're putting to S3, but according to the s3cmd instructions, it will echo something out for each file it pushes up. So...75 files, 75 echo statements. But, without seeing what any of the emails say, or knowing anything about your environment, we can't speculate much.
uploading to S3 with reduced redundancy...
Done uploading to s3, deleting files...
Finished!
Apparently it is sending an email for each loop, any idea how to stop that?
Loop?? The bash script you posted doesn't have a loop in it. Did you post the ENTIRE script, or just part of it? Or is that script called from another script somewhere?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.