08-18-2009
I do not have the supper user priviledge. The folders Application1_1 Application1_2 etc are owned by the Application1 account. They have a number of folders (corrosponding to versions of applications deployed and I wish to clear out the old versions based on size etc). Now as I do not have the previlidge to peep into those folders (Application1_1, Application1_2, etc) I am trying to sudo to Application1 to get the info. I just have an account apptest from which I can sudo su to the other Application accounts.
Here is the snippet from the expect I am trying to run, which is invoked through a shell script.
#################
#Main script master.sh
#################
#!/bin/bash
./sudoer
#some cleanup activity
.
.
.
#########################
#The expect script snippet "sudoer"
########################
#!/usr/bin/expect
spawn sudo su - Application1
expect "Password:"
send "Password123\r"
interact
#-> At this point the script gets blocked as a new shell is being invoked and does not return to the shell script at the top.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi
I'm trying to install gcc and the installation program tells me that I'm out of disk space! I have just installed the os (using the default settings for partitions and sizes) and have only installed apache on the machine. Can it really be out of disk space already?
How do I check how much... (4 Replies)
Discussion started by: alfabetman
4 Replies
2. Filesystems, Disks and Memory
I know I have posted this question before, but I still just don't understand how to determine disk space. This server is an IBM RS6000 running on AIX version 4.2.1.
I in essence need to know the following if anyone can assist me.
1) I need to know how many drives are configured in the... (2 Replies)
Discussion started by: Docboyeee
2 Replies
3. UNIX for Dummies Questions & Answers
Hello,
Can someone please tell me which command to use to determine the available disk space on a given disk device?
I have to write a shell script that compresses files and stores them in a specific location but I am not sure how "conservative" I should be?
Thanks in advance!
Al. (4 Replies)
Discussion started by: alan
4 Replies
4. HP-UX
Hi Experts.
I had 100% disk full , even though i have removed 2 GB space still dbf command shows 100%.
How to rectify that. Appreciate your prompt help. Thanks (1 Reply)
Discussion started by: test10002
1 Replies
5. Shell Programming and Scripting
HI ...
I am New to the Unix...I am trying to write a script to check the disk space.
But i am not able to write it.
I know the command to check the disk space df -k,but unable to write the script..Can any body help me...
Thanks in advance... (3 Replies)
Discussion started by: Kingkon
3 Replies
6. Filesystems, Disks and Memory
Hello All-
Am new member to this forum. Have some unix experience. But true believer in it compared to windows.
Have a question regarding the disk space.
I know a command to check the total disk space utilization using:
df -k .
but what is the command to check the same disk space by... (6 Replies)
Discussion started by: milkyway
6 Replies
7. Shell Programming and Scripting
Hi
This is my script for disk space monitoring
clear
if
then
echo "You must be root user to execute the script"
fi
ALERT_LEVEL=10
CONSUMPTION_LEVEL= `df -k | awk {'print $5'} | cut -d '%' -f1 | sed "1 d"`
for i in $CONSUMPTION_LEVEL
do
FILE_SYSTEM=`df -k | awk {'print $1'} |... (3 Replies)
Discussion started by: chrs0302
3 Replies
8. Red Hat
when i check
/export directory of my machine gets filled up (85%) i removed some old logs. but after cleaning df -k command still shows that /export is still 85% full.
Is there a way to force df to reflect actual free space without rebooting? My machine is a production one and can't... (8 Replies)
Discussion started by: aboorkuma
8 Replies
9. Shell Programming and Scripting
Hi Guys
i have a nice little piece of code then i need to modify so that is does not look at /Voulmes/*
thanks
sub disk_full {
my $i = 0;
open( DF, "df -l|" );
while (<DF>) {
#chomp();
next if (/^\/proc\b/);
$i++;
next if ( $i == 1 );
... (3 Replies)
Discussion started by: ab52
3 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I have this :
uname -a
Linux servername 2.6.18-194.11.3.el5PAE #1 SMP Mon Aug 23 15:57:10 EDT 2010 i686 i686 i386 GNU/Linux
df -k
Sys. de fich. 1K-blocs Occupied Disponible Capacity Monted on
/u01/applis 10321208 3190160 6606760 33% /applis
Does it mean... (1 Reply)
Discussion started by: big123456
1 Replies
LEARN ABOUT DEBIAN
sync-accounts-createuser
SYNC-ACCOUNTS-CREATEUSER(8) chiark utilities SYNC-ACCOUNTS-CREATEUSER(8)
NAME
sync-accounts-createuser - helper/hook program for sync-accounts
SYNOPSIS
SYNCUSER_CREATE_var=value... sync-accounts-createuser
DESCRIPTION
sync-accounts-createuser is invoked by sync-accounts when sync-accounts is creating a local account.
It must perform all of the tasks involved with local account creation except for the actual changes to the password, shadow and group data-
bases.
At the very minimum, it must create the new account's home directory (with appropriate permissions). The supplied sync-accounts-createuser
script does exactly that.
It may also suggest to sync-accounts modifications to the new account's passwd entry.
INVOCATION
When sync-accounts-createuser is invoked, the passwd and group entries will not yet have been set up, so it may not rely on them. sync-
accounts-createuser will not be supplied with any arguments. However, the following environment variables will be set, giving details
about the account to be created:
SYNCUSER_CREATE_USER
SYNCUSER_CREATE_UID
SYNCUSER_CREATE_GID
SYNCUSER_CREATE_COMMENT
SYNCUSER_CREATE_HOME
SYNCUSER_CREATE_SHELL
RESULTS
sync-accounts-createuser should usually produce no output.
It can inhibit the creation of the user by outputting a single line not containing a colon; in this case, a diagnostic message will be
written to sync-accounts's logfile, and the user will be skipped.
Alternatively, it may write out an alternative password file entry, in which case sync-accounts will use the supplied data for the local
passwd file instead of that from the remote host. The line should be in Sys-V passwd file format (regardless of localformat or remotefor-
mat settings). The username field should be taken from SYNCUSER_CREATE_USER, and the password field should be x.
EXIT STATUS
0 All went well, or we wrote a line without a colon to say that the account should not be created.
any other
There were serious problems and sync-accounts should bomb out immediately.
FILES
None.
ENVIRONMENT
See above.
BUGS
The supplied sync-accounts-createuser does not check that it was not supplied with any arguments; nor does it check that the SYNCUSER_CRE-
ATE_* variables are set, or have sensible values.
AUTHOR
sync-accounts-createuser and this manpage were written by Ian Jackson <ian@chiark.greenend.org.uk>. They are Copyright 1999-2002 Ian Jack-
son <ian@davenant.greenend.org.uk>. This manpage forms part of the sync-accounts package.
sync-accounts-createuser and the sync-accounts package are free software; you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
This is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, consult the Free Software Foundation's
website at www.fsf.org, or the GNU Project website at www.gnu.org.
SEE ALSO
sync-accounts(8), sync-accounts(5), passwd(5)
Greenend 14th July 2002 SYNC-ACCOUNTS-CREATEUSER(8)