Advertisement
Guest User

Untitled

a guest
Aug 25th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. 00 16,18,19,20,21 * * * mysql -h MY-DB-HOST.COM -u MY-DB-USERNAME -pMY-DB-PASSWORD -e "delete from hotaru_posts where post_id in ( select post_id from ( select post_id from hotaru_posts a group by post_title having count(post_title) > 1 ) b )" >> /tmp/cron_job.log
  2.  
  3. 00 8,14,18,19,20,21,23 * * * /usr/local/bin/php /home/aikaforum/cata/public_html/cron_dup.php >> /cata/tmp/cron_dup.log
  4.  
  5. <?php
  6. $username="xxxxxxx";
  7. $password="xxxxxx";
  8. $dbname="xxxxxx";
  9. $dbhost="xxxxx.xxxxx.com";
  10. $query="delete from hotaru_posts where post_id in ( select post_id from ( select post_id from hotaru_posts a group by post_title having count(post_title) > 1 ) b )";
  11. mysql_connect($dbhost,$username,$password);
  12. @mysql_select_db($dbname) or die(strftime('%c')." Unable to select database");
  13. mysql_query($query);
  14. mysql_close();
  15. echo strftime('%c')." ok!";
  16. ?>
  17.  
  18. echo "your_SQL_statement" | mysql --skip-column-names -udbuser -pdbpassword yourdb >> yourlog.log
  19.  
  20. mysql -u username dbname -e "delete from posts" > foo
  21. cat foo
  22. (empty file)
  23.  
  24. 00 16,18,19,20,21 * * * /usr/local/mysql/bin/mysql -h MY-DB-HOST.COM -u .....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement