for account in ${accounts}
do
`ssh -q id@server "touch EVENTS_${account}_${date}.log"`
done
Instead of doing ssh so many times, can I just do ssh and run the for loop and touch the files?
Instead of doing ssh so many times, can I just do ssh and run the for loop and touch the files? |
||||
|
|
|
ssh allows you to execute multiple commands. Simply separate each command with a semi-colon.
All the ": " does is says "proceed to the next command." It's so you're not starting your command with a semi-colon. Also, you don't need backticks around that command. |
||||
|
|
|
Run the loop on the remote machine.
Note that I assume that
Alternatively, mount the remote filesystem with sshfs and work on it as you would locally.
|
||||
|
|
Cluster ssh seems like the perfect tool for what you are trying to do.
|
|||
|
|