I'm trying to get my Pi to post the amount of used RAM to Twitter.
I'm using a script I modified myself from here, although I'm not very proficient in bash..
This is the file, it is located in /home/pi/bin/memtweet;
#! /bin/bash
# Configuration variables
TWIT_USER="USERNAME"
TWIT_SECRET="SUPERTWEET_PASS"
# Other variables
TWIT_URL="http://api.supertweet.net/1/statuses/update.xml"
TWEET=$(free -m | awk '/^Mem:/ { printf( "%s\n", $3 ); }')
curl -u $TWIT_USER:$TWIT_SECRET -d "status=RAM USAGE: $TWEET MB" $TWIT_URL -s > /dev/null
I'm using SuperTweet (as you can see) and echoing the amount of RAM, actually works.
I've use crontab -e to try and run it every 5 minutes (although I'll change it to hourly, I just wanted to see if it could work).
5 * * * * /home/pi/bin/memtweet
I've tried setting the cron for both root and the user, pi, but neither of them work.
Here's the last cron error I received when I was attempting to run the script through the pi user;
/bin/sh: 1: pi: not found
If anyone has an ideas as to how I could make this work, I would be very grateful!
EDIT: It looks like it could be the bash script, I've tried running it a few times and it doesn't seem to be posting to Twitter.
curl
command work on the command line?*/5 * * * * /home/pi/bin/memtweet