This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Backup TCL Script + e-Mail

Old posts that have not been replied to for several years.
Locked
B
BiLL
Halfop
Posts: 78
Joined: Wed Sep 26, 2001 8:00 pm
Location: Germany

Backup TCL Script + e-Mail

Post by BiLL »

Hello,

I am searching for a TCL script which sends me a few files from the shell via e-mail. Its function is to backup specified files from the shell.
The backup can be done via timer or public command (owner flag).

Would be nice if anyone can help me with such a script, I think
its useful and some other peeps would like to see it too.

Big Thanks!
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

set ufmail "foo@bar.com"

bind pub n !backup pub:backup

proc pub:backup {nick uhost hand chan arg} {
global userfile botnet-nick ufmail
if {![file exists $userfile]} {
    putserv "NOTICE $nick :Userfile can't be found for mailing.."
  } else {
    if {[catch {exec mail -s "$userfile from ${botnet-nick}" $ufmail < $userfile}]} {
      putserv "NOTICE $nick :Error sending $userfile."
    } else {
      putserv "NOTICE $nick :Sent $userfile."
    }
  }
  return 0
}
Once the game is over, the king and the pawn go back in the same box.
Locked