Turns out you can actually run commands remotely via SSH, plant some scripts on your server and boom you can clear your logs, backup your db and restart your webservers all without having to remote in; major help!
For example;
ssh -i /home/me/.ssh/mybox root@mybox.com '/var/www/apps/myapp/start-myapp.sh'
Here I'm specifying an ssh key file to use to connect to the remote box via the -i parameter, then the username root (because we want the script to have all the power it needs to without specifying sudo; web address of the box (or you can use the ip address). Then surrounding the command I want to run in single-quotes.
Simple effective and saves me from remoting in one night when I'm not myself, hitting the wrong key & doing something I really shouldn't ;-)





