Passing $_GET parameters to cron job

The $_GET[] & $_POST[] associative arrays are only initialized when your script is invoked via a web server. When invoked via the command line, parameters are passed in the $argv array, just like C. Contains an array of all the arguments passed to the script when running from the command line. Your command would be: … Read more

Linux shell script for database backup

After hours and hours work, I created a solution like the below. I copy paste for other people that can benefit. First create a script file and give this file executable permission. # cd /etc/cron.daily/ # touch /etc/cron.daily/dbbackup-daily.sh # chmod 755 /etc/cron.daily/dbbackup-daily.sh # vi /etc/cron.daily/dbbackup-daily.sh Then copy following lines into file with Shift+Ins #!/bin/sh now=”$(date … Read more

Cron every day at 6 pm

0 18 * * * command to be executed ^ you need to set the minute, too. Else it would be running every minute on the 18th hour How to setup a cronjob in general: # * * * * * command to execute # │ │ │ │ │ # │ │ │ │ … Read more