Monday, 5 August 2013

set cron tab in linux

1. crontab -e command open crontab file save path of file like
0 0 * * * /usr/syncservice/src/catalog.run.sh
0 0 * * * /usr/syncservice/src/catalog_aircel.run.sh
0 0 * * * /usr/syncservice/src/epgsync.run.sh
0 0 * * * /usr/syncservice/src/epgsync_aircel.run.sh
0 0 * * * /usr/syncservice/src/epgsync_hd.run.sh
0 0 * * * /root/MySQLdump.sh


in the path like ex:-

0 0 * * * /root/MySQLdump.sh

in MySQLdump.sh we write give code of mysql dump:- dump will be created every mid night.

mysqldump -u root -padmin123 unified > /root/mysqlBackup/unified/$(date +\%Y-\%m-\%d_\%Hh\%M).sql

mysqldump -u root -padmin123 unified_hd > /root/mysqlBackup/unified_hd/$(date +\%Y-\%m-\%d_\%Hh\%M).sql






find in set.



                                $this->db->where("((FIND_IN_SET('ALL',VVM_REGION_RIGHTS) > 0 or FIND_IN_SET('".$this->usrCountry."',VVM_REGION_RIGHTS) > 0) and FIND_IN_SET('!".$this->usrCountry."',VVM_REGION_RIGHTS) = 0)");