troubleshooting Question

Remotely creating a tar file via ssh

Avatar of David Aldridge
David AldridgeFlag for United States of America asked on
Shell ScriptingUnix OS
2 Comments1 Solution159 ViewsLast Modified:
I'm not even sure I can do this, but I want to have a script that ssh's to another server and creates a tar file on the remote server.  Is that even possible?  Here's what I have been working with, which isn't very much because I can't figure out how to make it work.

Thanks in advance for any help!
David

#!/usr/bin/ksh

server=$1

ssh $server 'tar cvf $server.logs.tar.gz /opt/bmc/Patrol3/log/Patrol*'
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros