Header Code

SSH

How to run a PHP script as Cron job from SSH (Linux shell) 12Nov, 2010

How to run a PHP script as Cron job from SSH (Linux shell)

You can run a PHP script on cron by setting up a crontab For this, first login to your shell using an SSH client such as PuTTY. And on the command line, type the following command (here # means the shell prompt): # crontab -e That will put you in the Vi editor editing your crontab. First press “i” to begin inserting, then type out your cron line following the format below for each line, then press the “escape” key on your keyboard to get out of insert mode, and then type “:wq” and press “enter” to save it. The form of a crontab file is: minute hour day month weekday command For example: 42 4 1 * * /usr/bin/php…

Posted in: Cron, SSH
How to use MySQL from SSH (Linux shell) 12Nov, 2010

How to use MySQL from SSH (Linux shell)

Using MySQL from SSH may seem to be quite tricky if you’ve never done it before – but fear not – below is a list of MySQL commands that you can use to perform the required actions. Start by logging-in using a SSH client, like PuTTY, to access the shell command line. Below when you see # it means from the unix shell. And when you see mysql> it means from a MySQL prompt after logging into MySQL. To login (from unix shell) use -h hostname only if needed # mysql -h hostname -u root -p This would ask you for a password and after providing the correct password you’d be logged-in to the MySQL prompt. If you get an…

Posted in: MySQL, SSH