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
ssh username@hostname -t 'sudo /usr/openv/netbackup/bin/admincmd/bppllist -L -U -allpolicies'
Since I want to capture output in a file , I ran below :
ssh username@hostname -t 'sudo /usr/openv/netbackup/bin/admincmd/bppllist -L -U -allpolicies > policydetails_tmp1.txt'
Error :
username@hostname's password:
The file access permissions do not allow the specified action.
ksh: policydetails_tmp1.txt: 0403-005 Cannot create the specified file.
I also ran below but it is running for long time. The command never takes long time.
ssh username@hostname -t 'sudo /usr/openv/netbackup/bin/admincmd/bppllist -L -U -allpolicies' > policydetails_tmp1.txt
Can someone please help me.
Thanks
Rahul