Sponsored Content
Top Forums Shell Programming and Scripting Check that 2 directories are the same Post 82037 by vertigo23 on Friday 26th of August 2005 01:19:17 PM
Old 08-26-2005
here's one way:
Code:
/you/are/in/original-dir$ md5sum `find . -type f` > /tmp/original.md5s
/path/to/copy/of/original-dir$ md5sum `find . -type f` > /tmp/new.md5s
/tmp$ diff ./original.md5s ./new.md5s

Hope this helps!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

What/How to check before deleting files and directories

Hi there, I have a some directories containing web files that are old, and I need to remove them. I know that there might be sym links and hyperlinks pointing to these old directories. If that's the case, then I'll have to fix the links before deleting these old directories to avoid broken... (4 Replies)
Discussion started by: yvochan
4 Replies

2. Shell Programming and Scripting

Check all files in directories for string and remove.. possible?

Say I am in /var/adm/bin and I want to search through all the various scripts and such in that directory for a string, say, xxx@yyy.com I want to find every file with that in there and replace it with a single space. Is that possible? Or, is it possible to search every file and get a list... (7 Replies)
Discussion started by: LordJezo
7 Replies

3. Shell Programming and Scripting

How to check if all directories of file's path exists?

I wonder if the script below is possible to write somehow more efficiently. It seems to me the problem is very common.. CreateFolders() # parameter: name of file with relative path with regard to directory $project_root { echo $1 | awk '{ n=split($1, array, "/"); ... (2 Replies)
Discussion started by: MartyIX
2 Replies

4. Shell Programming and Scripting

check if multiple directories exist else create missing directories

Hi , I 'm trying to check if multiple directories exist on a server, if not create the missing ones and print " creating missing directory. how to write this in a simple script, I have made my code complex if ; then taskStatus="Schema extract directory exists, checking if SQL,Count and... (7 Replies)
Discussion started by: ramky79
7 Replies

5. Shell Programming and Scripting

Check space of directories and send email if it has reached threshold limit

Hi, I need help in writing unix script for checking space of some directories on the system and also send an email when it reaches the threshold limit. I have written the followng code; #!/bin/ksh ADMIN="me@somewhere.com" # set alert level 80% is default THRESHOLD=80 df | grep -E... (5 Replies)
Discussion started by: jmathew99
5 Replies

6. Shell Programming and Scripting

delete and check directories

hi im so sorry i do not have time im doing an urgent cleanup. I have to check on directories for example: /export/home/itbr /export/home/bscsmig there are more but i have the list. how do i write a ksh script in for loop to check those directories and delete display a message if it was... (1 Reply)
Discussion started by: sbavanis
1 Replies

7. Shell Programming and Scripting

.sh script / Check for file in two directories then cat the files

Hi, Here is what i'm trying to do, -Check in two directories for a user inputed filename -Then cat all the version found of the file to the current screen I am a total nembie to programming, here what i have done so far.... #!/bin/bash #Check in /home/loonatic and /var/named/master... (2 Replies)
Discussion started by: Loonatic
2 Replies

8. Shell Programming and Scripting

how to check existance of multiple directories

Hi, I would like to check whether all the directories exists or not. I tried the below but it gives some error. below is the excerpt from my original script 24 #Check if the required directories are exists 25 dirExists() { 26 27 if 28 then 29 echo "required... (1 Reply)
Discussion started by: lookinginfo
1 Replies

9. Shell Programming and Scripting

Error check for copying growing directories

I have a simple script which copies directory from one place to another and deleting the source . I am facing a situation when new files gets added when the script has started running. Its resulting in data loss Please suggest a way to avoid data loss. I googled a lot but most are perl... (11 Replies)
Discussion started by: ningy
11 Replies

10. Shell Programming and Scripting

Shell script to check current date file is created and with >0 kb or not for multiple directories

Hi All, I am new in scripting and working in a project where we have RSyslog servers over CentOS v7 and more than 200 network devices are sending logs to each RSyslog servers. For each network devices individual folders create on the name of the each network devices IP addresses.The main... (7 Replies)
Discussion started by: Pinaki
7 Replies
lofs(7FS)							   File Systems 							 lofs(7FS)

NAME
lofs - loopback virtual file system SYNOPSIS
#include <sys/param.h> #include <sys/mount.h> int mount (const char* dir, const char* virtual, int mflag, lofs, NULL, 0); DESCRIPTION
The loopback file system device allows new, virtual file systems to be created, which provide access to existing files using alternate pathnames. Once the virtual file system is created, other file systems can be mounted within it, without affecting the original file sys- tem. However, file systems which are subsequently mounted onto the original file system are visible to the virtual file system, unless or until the corresponding mount point in the virtual file system is covered by a file system mounted there. virtual is the mount point for the virtual file system. dir is the pathname of the existing file system. mflag specifies the mount options; the MS_DATA bit in mflag must be set. If the MS_RDONLY bit in mflag is not set, accesses to the loop back file system are the same as for the underlying file system. Otherwise, all accesses in the loopback file system will be read-only. All other mount(2) options are inherited from the underlying file systems. A loopback mount of '/' onto /tmp/newroot allows the entire file system hierarchy to appear as if it were duplicated under /tmp/newroot, including any file systems mounted from remote NFS servers. All files would then be accessible either from a pathname relative to '/' or from a pathname relative to /tmp/newroot until such time as a file system is mounted in /tmp/newroot, or any of its subdirectories. Loopback mounts of '/' can be performed in conjunction with the chroot(2) system call, to provide a complete virtual file system to a process or family of processes. Recursive traversal of loopback mount points is not allowed. After the loopback mount of /tmp/newroot, the file /tmp/newroot/tmp/newroot does not contain yet another file system hierarchy; rather, it appears just as /tmp/newroot did before the loopback mount was performed (for example, as an empty directory). Examples lofs file systems are mounted using: mount -F lofs /tmp /mnt SEE ALSO
lofiadm(1M), mount(1M), chroot(2), mount(2), sysfs(2), vfstab(4), lofi(7D) WARNINGS
Loopback mounts must be used with care; the potential for confusing users and applications is enormous. A loopback mount entry in /etc/vfstab must be placed after the mount points of both directories it depends on. This is most easily accomplished by making the loop- back mount entry the last in /etc/vfstab. SunOS 5.10 10 Apr 2001 lofs(7FS)
All times are GMT -4. The time now is 01:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy