aboutsummaryrefslogtreecommitdiff
path: root/Autres
diff options
context:
space:
mode:
authorcitizenz7 <citizenz7@protonmail.com>2017-04-20 18:50:55 +0200
committercitizenz7 <citizenz7@protonmail.com>2017-04-20 18:50:55 +0200
commit5fd9fa480f302902328b81f912dd67ce378284f8 (patch)
tree66234843ae2857fda12442e4f7577c527d48977c /Autres
parentebe731862c7c741171138b1083906f391fc35aff (diff)
downloadfreetorrent-5fd9fa480f302902328b81f912dd67ce378284f8.tar.xz
freetorrent-5fd9fa480f302902328b81f912dd67ce378284f8.zip
V.1.4.6
Diffstat (limited to '')
-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