7.3 Using Plink in batch files and scripts
Once you have set up Plink to be able to log in to a remote server without any interactive prompting (see section 7.2.2), you can use it for lots of scripting and batch purposes. For example, to start a backup on a remote machine, you might use a command like:
plink root@myserver /etc/backups/do-backup.sh
Or perhaps you want to fetch all system log lines relating to a particular web area:
plink mysession grep /~fred/ /var/log/httpd/access.log > fredlog
Any non-interactive command you could usefully run on the server command line, you can run in a batch file using Plink in this way.