cron script needed to restart vsftpd if it is not running

Anybody have a script to check that vsftpd is running and start it if it is not?  I need to put such a script in cron to make sure my ftp service is always up (will check every 10 minutes).

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ps -a|grep -q vsftpd|vsftpd &

possibly you'll need to include the path of vsftpd and maybe the others if it's run from cron
I meant this, sorry:

ps -a|grep -q vsftpd||vsftpd &

Create a file and add following

if [ -f /var/lock/subsys/vsftpd ]; then
 echo "vsftpd is running "
 service vsftpd restart

# chmod 775

Now set it in root's cron

# crontab -e

And add this line

*/10 * * * * <path to>

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jdanAuthor Commented:
Thanks, that is just what i was looking for.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.