Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

problems running custom script / notification errors

Featured Replies

I set up a custom script as described here.

It works fine when I run it from the command line, but when I run it as a cron job I get this in the log-

Jan 11 20:00:01 Brunnhilde crond[1609]: exit status 127 from user root ./config/plugins/DS_Store-Cleanup/rmdotstore.sh /mnt/user/Media && /usr/local/emhttp/plugins/dynamix/scripts/notify -e "DS_Cleanup" -d "Removing .DS_Store files" -i "normal" -m "Cleaning DS_Store files from Media"
Jan 11 20:00:01 Brunnhilde sSMTP[20054]: Creating SSL connection to host
Jan 11 20:00:02 Brunnhilde sSMTP[20054]: SSL connection using AES128-GCM-SHA256
Jan 11 20:00:03 Brunnhilde sSMTP[20054]: 550 5.7.0 From address is not one of your addresses.

 

The .DS_Store files are not being deleted and I don't get a notification.

 

Not sure why it's failing. I've attached the complete log.

brunnhilde-syslog-20160111-2008.zip

Not sure if it'll make a difference but try changing it from ./config to /boot/config

  • Author

Thanks squid. I'll give that a shot.

  • Author

Didn't work. DS Store files are still not being deleted and I'm still getting errors in the log that the "From" is not one of my email addresses.

The big question is does the script work.  If it does (and I seem to recall that it does) then its something with the cron

  • Author

It worked when I ran it via telnet. Deleted test files I had saved to the share and sent the proper notifications. The log shows the script is running on time. The only difference I can see is that when I run the script via telnet I have to cd /boot first. Not sure if that changes anything.

 

Edit- I see a typo (DUH). I changed the script per your suggestion but typed in boot/config instead of /boot/config. Fixed now and I'll see what happens.

  • Author

Thanks again Squid. Fixed the typo and everything is working. DS Store file was deleted and notifications worked. Still have the error in the log that the "From" address is not one of my addresses. Not sure what's causing that but notifications still work.

Just for something to do, add an

exit 0

to the end of your script.  I *believe* (fully prepared to be wrong) that crontab tries to email root in the event of an abnormal exit.  (and maybe the last iteration of your find command is actually returning a non zero return code)

  • Author

Like this?

# DS_Store Cleanup for Media:
40 3 * * 3 /boot/config/plugins/DS_Store-Cleanup/rmdotstore.sh /mnt/user/Media  && /usr/local/emhttp/plugins/dynamix/scripts/notify -e "DS_Cleanup" -d "Removing .DS_Store files" -i "normal" -m "Cleaning DS_Store files from Media" && exit 0

 

  • Author

I think you're talking about the sh script-

#!/bin/bash
# ========================================================================== #
# Program Body                                                               #
# ========================================================================== #
((!$#)) && echo No Directory supplied! && exit 1

dir="$@"
echo $dir

echo "Removing .DS_Store files"
find "$dir" -name ".DS_Store" -exec rm '{}' \; -print

echo "======================="
echo "Removing ._ files"
find "$dir" -name "._*" -exec rm '{}' \; -print

Should I add the exit after the find at the bottom?

  • Author

Tried with both scripts and every combination I could think of. None made any difference. Seems to be working though, so it's really a minor issue.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.