08-08-2009
Thanks kshji. Yea, I didn't use your method. I will probably forget and then will be like why it is not working. ^^" Considering, the upgrades will not happen regularly. So, that was an issue. :P However, maybe I can use the same trick for something else. ^^
Thanks KenJackson. Yea, that did the trick. I used -m option in the inotifywait rather than do the while loop. If you made new directories like 3 at a time then it would not work; however, -m did the trick. ^^ Plus, I was able to use it for other events too. So, it was a pretty good utility for me.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Is there some command I can use to check to see if there is 2 Gig of space available in a directory before I created a 2 Gig file? (3 Replies)
Discussion started by: lesstjm
3 Replies
2. Shell Programming and Scripting
Hi,
I need to prompt for a response from a user to enter a path
read dest_dir?"Please Enter Directory :"
How do I do this until a valid directory is entered by the user. I can use
to check the existence of the directory. However when I try the following I cannot get it to work.
while ... (2 Replies)
Discussion started by: jerardfjay
2 Replies
3. UNIX for Dummies Questions & Answers
how say I have directory how can I get the directory size in mega and if it less then 1 mega so byts
Thanks (4 Replies)
Discussion started by: umen
4 Replies
4. UNIX for Dummies Questions & Answers
Hi,
what is the command to in unix shell to find whether a particular direcory is existing or not ?
example: i am now in ~/scripts directory and want to find if a direcory called 'log' exists or not from a shell scripts.
can somebody please help.
thanks,
sateesh (3 Replies)
Discussion started by: kotasateesh
3 Replies
5. Shell Programming and Scripting
I have the list of users in user.log, under each user folder there is sub1 folder is there. i want to check whether sub1 is empty or not, if it is empty i have to skip that user user folder and iterate next user folders. i have the sample code,its not giving not proper results.
while read line... (8 Replies)
Discussion started by: KiranKumarKarre
8 Replies
6. Shell Programming and Scripting
Hi All,
I have a requirement to check all the files in a directory and mail non empty files
Files are in csv format , i need to skip header while checking
pls help
Thanks (12 Replies)
Discussion started by: gwrm
12 Replies
7. Shell Programming and Scripting
Hi trying to read directory name and compare if exist or not,haw can I do that
thanks
#!/bin/bash
echo -n "Enter: "
read var
find . -name "$var" -type f (8 Replies)
Discussion started by: lio123
8 Replies
8. Shell Programming and Scripting
I want to know how you would go about checking if something is either a file or a directory. mostly for argument validation stuff.
I know -d is to see if its a directory but im guessing -f is for files?? (1 Reply)
Discussion started by: Waffles
1 Replies
9. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
1.pls tell me the command for checking whether a given directory is empty or not .
2. can i check what is the... (1 Reply)
Discussion started by: upvan111
1 Replies
10. Shell Programming and Scripting
How can i check in shell script if the file is coming from same directory as previous file. (3 Replies)
Discussion started by: Pratiksha Mehra
3 Replies
LEARN ABOUT MOJAVE
switch_root
SWITCH_ROOT(8) System Administration SWITCH_ROOT(8)
NAME
switch_root - switch to another filesystem as the root of the mount tree
SYNOPSIS
switch_root [-hV]
switch_root newroot init [arg...]
DESCRIPTION
switch_root moves already mounted /proc, /dev, /sys and /run to newroot and makes newroot the new root filesystem and starts init process.
WARNING: switch_root removes recursively all files and directories on the current root filesystem.
OPTIONS
-h, --help
Display help text and exit.
-V, --version
Display version information and exit.
RETURN VALUE
switch_root returns 0 on success and 1 on failure.
NOTES
switch_root will fail to function if newroot is not the root of a mount. If you want to switch root into a directory that does not meet
this requirement then you can first use a bind-mounting trick to turn any directory into a mount point:
mount --bind $DIR $DIR
SEE ALSO
chroot(2), init(8), mkinitrd(8), mount(8)
AUTHORS
Peter Jones <pjones@redhat.com>
Jeremy Katz <katzj@redhat.com>
Karel Zak <kzak@redhat.com>
AVAILABILITY
The switch_root command is part of the util-linux package and is available from https://www.kernel.org/pub/linux/utils/util-linux/.
util-linux June 2009 SWITCH_ROOT(8)