Sponsored Content
Full Discussion: Script to performs checks
Top Forums Shell Programming and Scripting Script to performs checks Post 302712457 by sv0081493 on Tuesday 9th of October 2012 08:00:37 AM
Old 10-09-2012
Script to performs checks

Hi ,

I need a script which performs below activity

I have one file named "testfile" in 9 different directories with same name.
I want to perform below action with each testfile of each directory.

Code:
 
if [ -s testfile ]; then
mv listfiles listfiles_`date +%b%y`
else
echo No Such files
fi

Writing this code 9 times is not a gud idea So I want to write it once in my script for all the 9 directories and perform the above activity.
Could you please help.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script that checks for previous instances running

Hello, I'm trying to write a script that checks for previous instances of the same script which may still be running (this script is scheduled to run every 30 minutes). I want to somehow use the pid from each instance to make sure the previous one isn't running before continuing with my... (5 Replies)
Discussion started by: bd_joy
5 Replies

2. Shell Programming and Scripting

Want to make a script that checks connection protocol

Hello all, I currently connect to several servers multiple times a day. Most of the time I connect via SSH through the terminal emulator poderosa (my personal favorite), but sometimes I connect via telnet through xstart because I need it to export a GUI. What I want to do is add something to... (3 Replies)
Discussion started by: DeCoTwc
3 Replies

3. Shell Programming and Scripting

Script to perform record format checks

Hi All, I have a requirement to perform the following checks. Input file is a "|" delimited file and looks like this. A|c1|c2|c3|.... B|G1|G2|G3.... C|H1|H2|H3... A|c4|c5|c6|.... B|G4|G5|G6.... C|H4|H5|H6... Now the check is to see if all the "A" records have a corresponding B... (7 Replies)
Discussion started by: gsjdrr
7 Replies

4. Shell Programming and Scripting

Perl script that checks against Future time

Ok, so this may be an unusual request. But I have a certificate that expires sometime in may of 2011. Now, i have to monitor this certificate and alert when the current time is within 30 days of may 20, 2011. #!/usr/bin/perl # use Time::Local; # $sec=59; $min=59; $hours=23; $day=31;... (3 Replies)
Discussion started by: SkySmart
3 Replies

5. Shell Programming and Scripting

[Bash] MD5 Checks with Script.

Hi. I'm triyng to make a Bash Script that checks (recursively) the MD5 from all the files in a certain directory and compare them against some other check that should be already done and saved in a file. I've reached to the point where i have the MD5 from the file and the MD5 that the script... (1 Reply)
Discussion started by: BiFo
1 Replies

6. Shell Programming and Scripting

Script to do the following checks

Hi , I need a script for processing below scenario. I have to check daily by doing ftp IP to check it is logging or not. So i want this activity to be automated such that if login succesful i will get "FTP LOGIN SUCCESS" in a log file and if fails i want the error message in the same log... (1 Reply)
Discussion started by: sv0081493
1 Replies

7. Shell Programming and Scripting

Script function which checks if itself is already running

Hi All, I have a cron job set up which is set to run every 10 seconds. What I need to do is have the script do a check to see if it is already running such that if it is running it wont fire up additional instances and processes according to its normal process. For example if I have a script... (4 Replies)
Discussion started by: landossa
4 Replies

8. Homework & Coursework Questions

Script performs the right task but fails against check

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: Write a script checkFiles.sh that takes an arbitrary number of file paths from the command line and carries ... (5 Replies)
Discussion started by: Ezraek
5 Replies

9. Shell Programming and Scripting

Help with delaying script and implementing checks before completion

Hello everyone, I was wondering if any of you could help me with this. I am an absolute beginner and don't know how to program, but I can follow a tutorial and tweak code sometimes. My understanding of programing is limitted to what for and while loops do, and how if then else logic works. That... (2 Replies)
Discussion started by: tomeurp
2 Replies

10. Shell Programming and Scripting

Script that performs action when receiving an SMS.

My case is the following: -I have a Linux system where I have an smsd installed (SmsTools3) -This system works through a GSM module in which I can send and receive text messages. -Text messages arrive in a certain folder (/ var / spool / sms / incoming) -I need a script that does... (3 Replies)
Discussion started by: dMihawkCL
3 Replies
unionfs-fuse(8) 														   unionfs-fuse(8)

NAME
unionfs-fuse - A userspace unionfs implementation SYNOPSIS
unionfs-fuse [-o option1 -o option2 ... -o optionN ] top_branch:lower_branch:...:lowest_branch mount_point DESCRIPTION
unionfs-fuse overlays several directory into one single mount point. It first tries to access the file on the top branch and if the file does not exist there, it continues on lower level branches. If the user tries to modify a file on a lower level read-only branch the file is copied to to a higher level read-write branch if the copy-on-write (cow) mode was enabled. OPTIONS
Below is a summary of unionfs-fuse options -o cow Enable copy-on-write -o stats Show statistics in the file 'stats' under the mountpoint. -o statfs_omit_ro By default blocks of all branches are counted in statfs() calls (e.g. by 'df'). On setting this option read-only branches will be omitted for the summary of blocks. This may sound weird but it actually fixes "wrong" percentage of free space. -o noinitgroups Since version 0.23 without any effect, just left over for compatibility. Might be removed in future versions. -o chroot=path Path to chroot into. By using this option unionfs-fuse may be used for live CDs or live USB sticks, etc. So it can serve "/" as filesystem. If you do not specify this option and try to use it for "/" it will deadlock on calling 'pivot_root'. If you do set this option, you also need to specify the branches relativly to the given chroot directory. See examples/S01a-unionfs-fuse-live- cd.sh for an example. -o max_files=number Maximum number of open files. Most system have a default of 1024 open files per process. For example if unionfs-fuse servs "/" applications like KDE or GNOME might have much more open files, which will make the unionfs-fuse process to exceed this limit. Sug- gested for "/" is >16000 or even >32000 files. If this limit exceeds unionfs-fuse will not be able to open further files. Options to libfuse There are several further options available, which don't directly apply to unionfs, but to libfuse. Please run "unionfs-fuse --help" to see these. We already set the "-o default-permissions" options on our own. EXAMPLES
unionfs-fuse -o cow,max_files=32768 -o allow_other,use_ino,suid,dev,nonempty /u/host/etc=RW:/u/group/etc=RO:/u/common/etc=RO /u/union/etc Meta data Like other filesystems unionfs-fuse also needs to store meta data. Well, presently only information about deleted files and directories need to be stored, but in future releases more information might be required, e.g. inode-numbers for persistent inode information. Meta data information are saved and looked for in the .unionfs/ directories of each branch-root. So in the example above, these are /u/host/etc/.unionfs, /u/group/etc/.unionfs and /u/common/etc/.unionfs. Within these directories a complete directory structure may be found. Example: If the admin decides to delete the file /etc/test/testfile, which only exists in /u/unionfs/etc/test/testfile, unionfs- fuse can't delete this file, since it is on a read-only branch. So instead the whiteout file /u/host/etc/.unionfs/test/testfile_HIDDEN~ will be created. So on accessing the union filesystem, test/testfile will not be visible. Please also note that whiteout files/directories will only hide the files in lower level branches. So for example whiteouts in the group directory (/u/group/etc/.unionfs of the example above) will only hide file of the common branch (/u/common/etc), but not these of the group and host branches. Especially for diskless- booted environments it is rather useful for the admin to create whiteout files him/her-self. For example one should blacklist network re- initializations, /etc/mtab, /etc/nologin of the server and several cron-scripts. This can be easily achieved by creating whiteout files for these scripts in the group meta directory. KNOWN ISSUES
1) Another issue is that presently there is no support for read-only branches when copy-on-write is disabled, thus, -ocow is NOT specified! Support for that might be added in later releases. AUTHORS
unionfs-fuse Original implemention by Radek Podgorny <radek@podgorny.cz> COPYRIGHT
Radek Podgorny <radek@podgorny.cz>, Bernd Schubert <bernd-schubert@gmx.de> THANKS
Many thanks to the author of the FUSE filesystem Miklos Szeredi. unionfs-fuse 0.21 June 2008 unionfs-fuse(8)
All times are GMT -4. The time now is 03:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy