Archive for March, 2012

How add a cronjob under user apache

Thursday, March 22nd, 2012

if you want to setup a cron job under different user or under apache, find out who is the owner of apache process

ps aux | grep apache

in my case the owner of apache process is “daemon”.
now create a cron job under “demon” user

crontab -u daemon -e

Now insert any cron job

* * * * *  cd /usr/local/apache/htdocs/website; /usr/local/bin/php webpage.php  > /dev/null 2>&1

References

Monday, March 5th, 2012

(a)Restarting the Management agents on an ESX or ESXi Server

Ref: http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=1003490

Log in to your ESX host as root from either an SSH session or directly from the console.
Run this command:
 
service mgmt-vmware restart
 
Caution: Ensure Automatic Startup/Shutdown of virtual machines is disabled before running this command or you risk rebooting the virtual machines. For more information, see Restarting hostd (mgmt-vmware) on ESX hosts restarts hosted virtual machines where virtual machine Startup/Shutdown is enabled (1003312) and Determining whether virtual machines are configured to autostart (1000163).
Press Enter.
Run this command:
 
service vmware-vpxa restart
 
Press Enter.
Type logout and press Enter to disconnect from the ESX host.
 
If this process is successful, it appears as:
 
[root@server]# service mgmt-vmware restart
Stopping VMware ESX Server Management services:
VMware ESX Server Host Agent Watchdog [ OK ]
VMware ESX Server Host Agent [ OK ]
Starting VMware ESX Server Management services:
VMware ESX Server Host Agent (background) [ OK ]
Availability report startup (background) [ OK ]
[root@server]# service vmware-vpxa restart
Stopping vmware-vpxa: [ OK ]
Starting vmware-vpxa: [ OK ]
[root@server]#