I have a Linux box, where some NAS shares are mounted. One script is running on it and failing because it first looks at second line of 'ls -l', when it says 'total 0', it fails.
If that directory is on local disk, it says 'total 38' and when same data is on NAS share, it says 'total 0' and it fails that script to run.
Is this something which can be changed ? I know that it shows block size occupied by data inside that directory, but why it doesn't show when same data is on NAS file-system ?
Can you post the output of the various commands you are referencing. You're talking about a script we can't see. What is the actual output of the network mounted directory and what is the actual output of it when it's local. A mounted directory (if not actually mounted) may show 0, so I would first suspect that the mount has failed if it is showing 0 files.
This server is a linux virtual server and /dev/simfs is a NAS device, which is mounted as /export on this virtual server.
There is a script setup in cronjob developed by application team and it says, if total = 0 then do not proceed, if total = more than 1, that file should be sent to some ftp site. Script is not a problem for me, but I was concerned only for that total value. NAS is properly mounted and lot of other users are able to read/write on it, but is there anything else that can be changed from OS side ? I am getting in touch with Storage team also to understand its behavior.
I am relatively new to Unix and I would be grateful if someone could help me with the syntax of a script.
I am trying to write a Unix script against the file ‘ajtest.dat’ (see below) so that it outputs the number of rows and total value of column 3 in a file called ‘aj1’ as follows:
No. of... (11 Replies)
Good afternoon! Im new at scripting and Im trying to write a script to
calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting... (4 Replies)
I have a while loop which looks for files and then sets a variable to give me the record count of each file:
current_members=`wc -l ${DATA_DIR}/$MEMBERS_FILENAME | nawk '{ printf "%d\n", $0}'`
I am out putting the totals into a file:
echo $current_members >> ../data/out_total_members.dat
... (7 Replies)
Hi All
Can anyone help me with the following du querry. I am trying to achieve a total size for all the zipped files in a directory. Using du -k *.gz gets me a file by file list but no handy total at the bottom.
Thanks
Ed (9 Replies)
Ok, another fun hiccup in my UNIX learning curve. I am trying to count the number of occurrences of an IP address across multiple files named example.hits. I can extract the number of occurrences from the files individually but when you use grep -c with multiple files you get the output similar to... (5 Replies)