* * * * * /usr/bin/mysqldump -h localhost -u source -p root mydb | gzip > /var/backup/all/database_`date +%Y-%m-%d`.sql.gz >/dev/null 2>&1when the crontab operation there is no backup record in the folder (my backup/all has actually the permission scheme 755).
This is error from /var/log/syslog
Aug 16 11:55:01 precise64 CRON<2213>: (vagrant) CMD (/usr/bin/mysqldump -h localhost -u root -p source mydb | gzip > /var/backup/all/database_`date +%Y-%m-%d`.sql.gz >/dev/null 2>&1)Aug 16 11:55:01 precise64 CRON<2212>: (CRON) details (No MTA installed, discarding output)So i thinkit"s around crontab can"t develop backup document because of Permission denied.it"s about I"m didn"t install MTA but I use >/dev/null 2>&1 to disable crontab to sent it to email why that error ?
boost this question
edited Aug 21 "14 at 11:58
6,69655 yellow badges2525 silver badges5454 bronze badges
asked Aug 16 "14 in ~ 15:26
Kanin PeanviriyakulkitKanin Peanviriyakulkit
16511 gold badge11 silver- badge44 bronze title
include a comment |
3 answers 3
energetic earliest Votes
Of course, the error is that you don"t have actually a mailer (sendmail,postfix, etc) implemented and also active.
That being stated your other trouble is the the >/dev/null 2>&1 only only applies/associates come the last command in this case gzip. Thus there need to be some kind of output going to STDERR for your mysqldump.
You are watching: Cron info no mta installed discarding output
The correct way to do what ns think you want is:
* * * * * (command | command ) >/dev/null 2>&1
enhance this price
answered Aug 16 "14 in ~ 18:20
6,25633 yellow badges2727 silver- badges4242 bronze badges
add a comment |
You can put:
MAILTO=""at the beginning of her crontab paper and the will stop it native trying to send email.
improve this price
answered may 21 "16 at 3:30
Michael ElkevizthMichael Elkevizth
16111 silver- badge22 bronze title
include a comment |
If the user running the crontab command is vagrant, and also the catalog where the calculation is created to is owned by root, and also has permissions 755, it deserve to not be written to.sudo chown vagrant /var/backup/allmay fix that.
To examine whether that"s the problem, try writing to a document in /tmp instead.
But there is one more problem: A command likemysqldump mydb | gzip > database.sql.gz >/dev/null 2>&1writes the database dump come database.sql.gz and also to /dev/null.The 2>&1 copies the error messages to the standart output, that method it likewise writes the error messages to database.sql.gz. That writes error post text just some where in between the compressed data, for this reason the compressed document will it is in broken. Keep in mind it might work fine when testing - together the trouble only occurs when something is written to the traditional error stream. The output to stderr might be simply a warning, while everything else works.
See more: How Many Grams Are In A Ton, How To Convert Us Tons To Grams
I i think you intend to compose the compressed database dump come the sql.gz file, and the errors to /dev/null. Because that this, simply keep the calculation streams separate, by no copying the error stream come the calculation stream. And also direct them to the files like this:
mysqldump mydb | gzip > /var/backup/all/database_`date +%Y-%m-%d`.sql.gz 2>/dev/nullThe error article "(No MTA installed, discarding output)" is cron informing you the it deserve to not send friend the error output. That will certainly be no trouble in the finish as girlfriend redirect errors come /dev/null anyway, there will be nothing come send. However I suspect that right now there space error messages to send, that have to confirm my findings above.