aboutsummaryrefslogtreecommitdiff
path: root/Autres
diff options
context:
space:
mode:
Diffstat (limited to 'Autres')
-rw-r--r--Autres/crontab.php14
-rw-r--r--Autres/crontab.txt4
2 files changed, 18 insertions, 0 deletions
diff --git a/Autres/crontab.php b/Autres/crontab.php
new file mode 100644
index 0000000..b23b83c
--- /dev/null
+++ b/Autres/crontab.php
@@ -0,0 +1,14 @@
+<?php
+
+//Identifiants SQL
+define('DBHOST','localhost');
+define('DBUSER','c4_freetorrent');
+define('DBPASS','1b10"yujl/qnN2)?L{WtT]),%s)y|(Tm');
+define('DBNAME','c4_freetorrent');
+
+//Connexion SQL
+$db = new PDO("mysql:host=".DBHOST.";port=8889;dbname=".DBNAME, DBUSER, DBPASS);
+$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+
+$stmt = $db->query('DELETE FROM xbt_announce_log WHERE mtime < (NOW() - INTERVAL 59 MINUTE)');
+?>
diff --git a/Autres/crontab.txt b/Autres/crontab.txt
new file mode 100644
index 0000000..d8ac47e
--- /dev/null
+++ b/Autres/crontab.txt
@@ -0,0 +1,4 @@
+# sudo -s
+# crontab -e
+# Freetorrent.fr : on vide xbt_announce_log - crontab toutes les 2 heures
+0 */2 * * * php /var/www/freetorrent.fr/private/crontab.php