How to execute command remotely as sudo and save the output locally?
Hello ,
I am trying to run a NetBackup command in remote server. Also this command can only be run by root so I am using sudo . Also I want the output of the command locally in a file.
The below command asked for password , ran successfully and showed Output on my local server screen
Since I want to capture output in a file , I ran below :
Error :
I also ran below but it is running for long time. The command never takes long time.
Hi folks,
Please advise which command/command line shall I run;
1) to display the command and its output on console
2) simultaneous to save the command and its output on a file
I tried tee command as follows;
$ ps aux | grep mysql | tee /path/to/output.txt
It displayed the... (7 Replies)
Hi all,
is it possible to save the output of a unix command executed in perl to be saved in hash variable..
like i have the command
`find $mypath ! -user mainuser -printf \"\%u \%h\\n\"`;
this will print all the users other than mainuser with their paths.
so is possible to capture... (2 Replies)
hi, everyone:
I just wonder how to save the output of command, I mean everything, save as a string into a variable.
another question is I try to ls the details of a directory, but it works in the shell, not in the script.
for example
code: ls -ltr *se100* | grep ^- | tail -1 | awk '... (1 Reply)
Dear All,
I am writing a script and kind of stuck in a small thing. Cannot figure it out. so please help
I am logged in as root user. I want to switch user to "user1" inside the script and execute a specific command lets say "pwd" and come back where i started.
I know how to switch user,... (16 Replies)
Hello,
Before I go typing a lot of stuff that may be useless. Here is the summary of my problem:
========================================================================================================
I cannot log in locally on my Solaris 10/09 x64 system. When I try to log in using my... (8 Replies)
Hi,
in shell script, i have the command swstart -p which returns an output. i want to store the output of this command into a variable. how i can do that
excerpt from the script
#!/usr/bin/ksh
#
#
#
# Program: swstart -p
#
# Description: Starts the sentinels on Slave server
... (4 Replies)
Hi all,
Today I want to write a script to run the commands remotely.
If I run the command as follows:
ssh <user>@<ip> 'ls; pwd'
it works fine.
But when I want to use ssh to set view in clearcase, it will lose the response. as follows
ssh <user>@<ip> 'cleartool setview <view_name>; pwd'... (1 Reply)
I am trying to modify the "corestat v1.1" code which is in Perl.The typical output of this code is below:
Core Utilization
CoreId %Usr %Sys %Total
------ ----- ----- ------
5 4.91 0.01 4.92
6 0.06 ... (0 Replies)
Hello,
Please, what is the difference between running a script remotely:
ssh -t root@$machine -x "sshpass -p 'ubuntu' ssh -t ubuntu@$address -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/nul -x './c-launch.sh'"
and running a script directly on the host:
... (1 Reply)
Discussion started by: chercheur111
1 Replies
LEARN ABOUT SUNOS
delete-instance
asadmin-delete-instance(1AS) User Commands asadmin-delete-instance(1AS)NAME
delete-instance - deletes the instance that is not running.
SYNOPSIS
delete-instance [--user admin_user] [--password admin_password] [--host localhost] [--port 4848] [--local=false] [--domain domain_name]
[--passwordfile filename] [--secure|-s]instance_name
Use the delete-instance command to delete the instance that you specify. The delete-instance command can be run both locally and remotely.
To delete the instance locally, not requiring the administration server to be up and running, specify the --local option. To delete the
instance remotely, the administration server must be running on the hostname and port number specified. The user authenticates using the
password identified for the administration server. Additionally, the instance must already exist within the domain served by the adminis-
tration server. Use this command with discretion since it is destructive and there is no undo.
OPTIONS --user administrative user associated for the instance.
--password administrative password corresponding to the administrative user.
--host host name of the machine hosting the administrative instance.
--port administrative port number associated with the administrative host.
--domain name of the domain.
--local determines if the command should delegate the request to administrative instance or run locally.
--passwordfile file containing passwords appropriate for the command (e.g., administrative instance).
--secure if true, SSL/TLS to communicate with the administrative instance.
OPERANDS
instance_name name of the instance to be deleted.
Example 1: Using delete-instance in local mode
asadmin> delete-instance --domain domain1 server1
Deleted Instance server1 successfully
Where: the server1 instance for the domain1 domain is deleted on the local machine.
Example 2: Using delete-instance in remote mode
asadmin> delete-instance --user admin --passwordfile passwords.txt --host localhost --port 4848 server1
Deleted Instance server1 successfully
Where: the server1 instance for the domain associated with the specified user, passwords in the password file, host, and port number is
deleted on the remote machine.
EXIT STATUS
0 command executed successfully
1 error in executing the command
INTERFACE EQUIVALENT
Server Instance page
asadmin-create-instance(1AS), asadmin-start-instance(1AS), asadmin-stop-instance(1AS), asadmin-restart-instance(1AS)J2EE 1.4 SDK March 2004 asadmin-delete-instance(1AS)