Exemple avec l'utilisateur salorium qui est dans le /home :
/home/salorium/torrentend.sh
#! /bin/bash
w=$(basename $2)
echo " - $1 ($2)<br>" >> ~/torrentend.txt
chmod a+x torrentend.sh
Ajouté à la fin du .rtorrent.rc :
method.set_key = event.download.finished,noty,"execute={/home/salorium/torrentend.sh,$d.name=,$d.base_path=,$d.base_filename=}"
/home/salorium/sendmail.php
<?php
/**
* Created by PhpStorm.
* User: salorium
* Date: 19/08/15
* Time: 15:25
*/
$content = file_get_contents("/home/salorium/torrentend.txt");
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
$headers .= 'From: no-reply@domaine.com' . "\r\n";
$content = "<html><body>Torrents téléchargés ce ".date('l j F')." :<br>".$content."</body></html>";
mail("email du destinataire", mb_encode_mimeheader("Torrent terminés", "UTF-8"), $content, $headers);
unlink("/home/salorium/torrentend.txt");
?>
Configurer un cron pour que le script php s'exécute à l'heure prévu