Twittering my System Status
Good day all,
I am trying to get my system to twitter it's status to me. I am just starting with system uptime at the moment, to try and get that working. This is the script that I am using: Code:
#!/bin/bash Code:
*/10 * * * * /bin/sh /path/to/your/twitter/script.sh My PC uptime is $(uptime) ?My and My PC uptime is For those that want to see the tweets - check out skyegod on twitter This is where I got the source for this code from. If somebody could help I would really appreciate it BTW - running Mepis 8. Thanks |
First of all, I don't think the /bin/sh is needed, because the first line in the script already calls /bin/bash to run itself.
Second, it seems like putting the sent data in the cronjob command itself is a rather sloppy way to go about it. Why not include the uptime information in the script itself instead? You can use the function syntax, which will make it easier to modify or add other information in the future the same way. Code:
#!/bin/bash Code:
*/10 * * * * /path/to/your/twitter/script.sh Edit: Come to think about it, the /bin/sh is probably there because it needs to run the $(uptime) command outside of the script. Moving uptime inside the script is what makes it unnecessary. |
Thank you -
I will give that a shot later when I get home. Thanks again |
All times are GMT -5. The time now is 05:18 AM. |