Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Script E-Mail Notification for borg backup

    Scheduled Pinned Locked Moved General pfSense Questions
    3 Posts 2 Posters 1.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • junicastJ
      junicast
      last edited by junicast

      Hi,

      pfSense 2.4.4

      we use borg to backup our Linux servers. Since there's a portable borg binary for freebsd which works quite nice with pfsense we decided to backup pfSense via borg, too.

      I wrote a script that inits, creates, lists or prunes a backup. Then I installed the pfsense cron package to schedule the tasks. Everything is working as expected.

      There's only one task left for me. I want a notification if the backup fails via E-Mail.
      I setup E-Mail Notifications under System - Advanced - Notifications.
      Is there any trivial way to utilize this setup?

      I only found very old threads about this topic that actually do not help. That's why I created a new thread.

      Thank you
      pmisch

      1 Reply Last reply Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        Depends on how the program intends to send e-mail. If it relies on sendmail being installed, it may not work. You might try installing the arpwatch package, though. It installs a stub that pretends to be sendmail but uses the GUI mail notification settings.

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 1
        • junicastJ
          junicast
          last edited by junicast

          Thanks for the fast answer. It's a shell script I wrote so the only requirement for the method is that I can do it via command line.

          I installed pfSense-pkg-arpwatch and tried successfully via: echo "test" | sendmail recipient@email.com

          The only downside is that the sender is "Arpwatch Notification" but since that's only cosmetic I will stick to this approach.
          Thank you

          Edit:
          As it turns out there's a mail.php that I can utilize, without the need to install arpwatch package and without the cosmetic flaws. echo "test" | mail.php -s"subject" recipient@email.com

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.