telot Posted May 28, 2012 Share Posted May 28, 2012 Anyone here use the cron on the pineapple? I can't seem to get it to work. Heres my crontab entry from the 'Jobs' gui: */5 * * * * /www/pineapple/scripts/cleanup.sh */5 * * * * /www/pineapple/ssh/ssh-keepalive.sh */5 * * * * /usb/pinesave/telotreport.sh Inside /usb/pinesave/telotreport.sh: #!/bin/bash TODAY=$(date +"%m-%d-%y") rm /usb/emailreport.log du -h /usb/cap.$TODAY.pcap > /usb/emailreport.log cat /www/pineapple/logs/associations.log >> /usb/emailreport.log cat /www/pineapple/logs/urlsnarf.log >> /usb/emailreport.log ./usb/killurlsnarf.sh ./usb/starturlsnarf.sh cat /www/pineapple/logs/dnsspoof.log >> /usb/emailreport.log cat /proc/net/arp >> /usb/emailreport.log cat /tmp/dhcp.leases; echo '\n'; cat /proc/net/arp; echo '\n'; grep KARMA /tmp/karma.log | grep -v -e enabled | grep -v -e malloc | grep -v -e CTRL_IFACE | grep -v -e KARMA_STATE | grep -v -e Request >> /us$ ssmtp -v telot@telotsemail.com < /usb/emailreport.log I know, I know, its a very rough draft of my email reports module I'll make someday. So as you can see, I remove the old log, take a size reading on today's capture file, cat the urlsnarf.log and restart it, then cat a bunch of other things and email it off. Just running the script works great - I get the email and its got all the goodies in it. I was hoping to get this to be sent to me every hour or two, but wanted to test it on 5 minute intervals. Most unfortunately I don't ever receive any emails. So I ran a test - I put a script in /www/pineapple/scripts/ called test.sh - in it is simply: #!/bin/sh touch /www/testthis I added it to the cron (again, on the Jobs page) for 5 minute intervals - now it looks like this: */5 * * * * /www/pineapple/scripts/cleanup.sh */5 * * * * /www/pineapple/ssh/ssh-keepalive.sh */5 * * * * /www/pineapple/scripts/test.sh Came back 6 minutes later and ls /www/ and testthis is there. So what is stopping telotreport.sh from working? They're both chmod +x'd - same permissions as the cleanup.sh script. Any advice would be greatly appreciated. Thanks guys telot Quote Link to comment Share on other sites More sharing options...
brianzimm Posted May 29, 2012 Share Posted May 29, 2012 I use cron for the ddns module. I know during the Mk4 2.1 beta cron had to be restarted manually to get new jobs to run. (This is fixed now in Mk4 2.1 final) Not to say you did not but did you wait for 5min (10min)? (I think your 5min job will be scheduled with the cleanup and ssh-keepalive) Other than that, no clue what it is doing. Quote Link to comment Share on other sites More sharing options...
PineDominator Posted May 29, 2012 Share Posted May 29, 2012 I want to point out I noticed now that the time gets updated "NTP" because of that I had to switch where to put start up scripts because now the timing is not guaranteed;-) Quote Link to comment Share on other sites More sharing options...
Whistle Master Posted May 29, 2012 Share Posted May 29, 2012 (edited) Just my 2c: I did a module, logcheck, which can filter the pineapple log for any information you're looking for and also a custom script part, all this sent by email every 30 minutes (can be changed on the jobs page). You could use the custom part with your script, without the last line ssmtp :) I know, I do not help you much with your issue though Maybe something to look at: I had problems for some of my modules with scripts using bash (#!/bin/bash) and changed to sh (#!/bin/sh). I don't know if it is the problem in your case. Edited May 29, 2012 by Whistle Master Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.