A Stefan Klopp Weblog
Random header image... Refresh for more!

Category — Linux

Top not working via Cron

For the past few days I have been banging my head against a wall as to why top would not give any output when run from cron. When the same script was run via the command line it worked fine, however via cron no output. I finally found out that top wants to know a terminal, or else it dies not so graciously. So to fix the problem simply put:

TERM=vt100

In front of your top command and all should be well. So my call looks something like:

TERM=vt100 /usr/bin/top -b -n 3 -d 3

August 8, 2008   No Comments

Verizon 450 Requested mail action not taken-Try later

Are you running a website or a server in which you are having trouble sending emails to verizon.net email accounts? Are you getting errors when trying to send emails, or messages in your log files such as:

450 Requested mail action not taken-Try later

Well for the longest time I couldn’t figure out why I couldn’t send to verizon.net customers, I read all the forums that talked about it (do a google search there are plenty) and yet still couldn’t figure out why our sites couldn’t send to Verizon. I decided to give up on the issue as I was going around in circles trying to figure out what the problem was.

Lately I decided this issue needed to be solved and that I would get to the bottom of things once and for all. I went back and started scouring all the message boards and forums regarding this issue until finally coming to this discussion: http://www.issociate.de/board/post/129726/Timeout_question.html

After reading what the users were saying in this post I was able to figure out what the problem was.

Verizon to fight against spam checks the senders email address once it gets sent to it via a MAIL FROM: . It will connect to the mail server of that domain and check to see if that user exists. If the user exists it will allow the user to send mail to a verizon client, if not it will give you this error.

So how do you fix this problem? Well first check in your logs what email address is trying to send emails to verizon.net. This will usually be denoted by a “from: ” in your log files. Next you will need to make sure that the domain trying to send the email has an MX record setup for it to point to the mail server that handles that domain. Lastly (very important) make sure that you can connect to the mail server from the internet. The reason my mail was never being sent out to my clients was mainly because we blocked incomming smtp connections, which meant that verizon could never verify if the user sending the email actually existed.

February 24, 2005   21 Comments

Using xargs

xargs can be a very handy tool when you need to use a command on a large number of arguments and you are getting errors such as:

Argument list too long

Using xargs is quite simple, you just need to pipe a command that gets your argument list into the xargs command. For example an easy way to delete all the contents of a directory if there are too many arguments is to do the following:

ls | xargs rm

or if you want to tar all the files in a directory and the list is too large you could do the following:

ls |xargs tar cvf big_file.tar.gz

xargs could also be very useful with the find command. Lets say for example you wanted to tar up all the mp3’s on your computer, you could do it with the following:

find / -name *.mp3 -type f -print | xargs tar -cvzf mp3s.tar.gz

For more on the use of xargs check out:

December 21, 2004   4 Comments