Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 09-22-2014, 10:06 PM   #1
mkx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
Running a putty cmd line through php script

I have to login to root with putty daily to type in "sendmail -q" to process the mail queue. Is there a way for me to do this through a php script instead so I can have someone else do this whom I don't want to give root access? Maybe even a cron job? I use cpanel
mkx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-22-2014, 10:44 PM   #2
codingwelt
AdultCoding.com PHP Freak
 
Industry Role:
Join Date: Sep 2014
Location: Austria (Europe)
Posts: 58
It's possible, yes. But you shouldn't let a script log in as root user. You could allow a non-/less-privileged user to execute the command using php, so there wouldn't be that much impact if someone got access to the login details stored in the php file.
(see PHP commands like "exec", "system", "passthru", ... for executing system commands.)

But, why aren't you creating a cronjob for root user that executes sendmail -q for you? There's no need to do this in PHP if not absolutely necessary.
__________________
AdultCoding.com Webdevelopment - info [smth] adultcoding [smthelse] com - Skype: AdultCoding
Individual PHP development following the latest standards in the web industry.
Get in touch for a custom offer, now!
codingwelt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-22-2014, 11:00 PM   #3
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
Quote:
Originally Posted by codingwelt View Post
But, why aren't you creating a cronjob for root user that executes sendmail -q for you? There's no need to do this in PHP if not absolutely necessary.
You just asked a user who called the shell "putty" (an app) why they aren't using a cronjob. Do you think they know what any of that means?
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-22-2014, 11:08 PM   #4
mkx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
what do I put as the command for the cron job in cpanel, I can do that
mkx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-22-2014, 11:09 PM   #5
Babaganoosh
♥♥♥ Likes Hugs ♥♥♥
 
Babaganoosh's Avatar
 
Industry Role:
Join Date: Nov 2001
Location: /home
Posts: 15,841
Better question is why is your queue filling up?
__________________
I like pie.
Babaganoosh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-22-2014, 11:19 PM   #6
mkx
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Location: Toronto
Posts: 4,001
I have 50 emails going out at the same time during a certain part of the day
mkx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-22-2014, 11:24 PM   #7
freecartoonporn
Confirmed User
 
freecartoonporn's Avatar
 
Industry Role:
Join Date: Jan 2012
Location: NC
Posts: 7,681
if you just want to fire a command then you dont need a script , just add a cronjob of the same.

become root
crontab -e
//time interval //insert your crontab command
save n exit.

somthig like this.
freecartoonporn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-22-2014, 11:43 PM   #8
fuzebox
making it rain
 
fuzebox's Avatar
 
Industry Role:
Join Date: Oct 2003
Location: seattle
Posts: 21,665
Quote:
Originally Posted by edgeprod View Post
You just asked a user who called the shell "putty" (an app) why they aren't using a cronjob. Do you think they know what any of that means?
fuzebox is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-23-2014, 01:53 AM   #9
codingwelt
AdultCoding.com PHP Freak
 
Industry Role:
Join Date: Sep 2014
Location: Austria (Europe)
Posts: 58
Quote:
Originally Posted by edgeprod View Post
You just asked a user who called the shell "putty" (an app) why they aren't using a cronjob. Do you think they know what any of that means?
Nope, but maybe it will help someone who has the same problem, anytime soon...
__________________
AdultCoding.com Webdevelopment - info [smth] adultcoding [smthelse] com - Skype: AdultCoding
Individual PHP development following the latest standards in the web industry.
Get in touch for a custom offer, now!
codingwelt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-23-2014, 02:05 AM   #10
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
Quote:
Originally Posted by codingwelt View Post
Nope, but maybe it will help someone who has the same problem, anytime soon...
Maybe. I'd say that someone with that level of technical sophistication doesn't need help.
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.