Restrict Max file size


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Restrict Max file size
# 1  
Old 08-29-2011
Restrict Max file size

Hello All,

I am working on an issue, where I need to check the max file size of a file. If the file size exceeds 2 GB, then I need to generate an error message. Since the file system does not allow a file to be created larger than 2 GB, I am planning to use named pipes & AWK file to acheive my purpose.

It would be great if someone helps me on this.

Thanks in advance,
Puru
# 2  
Old 08-29-2011
Do you believe a FileSystem that has the 2GB files size limit will let you create a file greater?
# 3  
Old 08-29-2011
Hi,

Yes, the unix box will not allow me to create a file that exceeds 2 Gig in size. ? But what I want to do is:
1) Keep a track on file size (by some logic that I am trying to think off
2) Catch the error that I will get when the file size exceeds the max size
3) Need to notify the users.

Thanks.
# 4  
Old 08-29-2011
What for do you want to keep track of the file size? Your main goal seems to be to notify the user when an error occurs. So steps 2 and 3 should be sufficient.
# 5  
Old 08-29-2011
@ CERO:

Yes, you are right. 2nd & 3rd step is needed. Could you please provide some guidence of doing that?
# 6  
Old 08-29-2011
How is that file created/grown?
Do you have control of that process? If so you most likely can react on the return code.
Another way would be to check your systems logs for errormessages (that would be the only way that comes to my mind if you do not control the process) and some systems allow mail notification for errors.
This User Gave Thanks to cero For This Post:
# 7  
Old 08-29-2011
Hello All,

I could find some solution, where I can redirect the data that I am creating into a pipe. As pipe can hold more than 2 GB, we can use the split -b option to check, if the no. of file created are more than 1. By doing this I was able to resolve the issue.

Thanks for the help Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Clamd max file size Solaris 10

Hi, I've compiled a 64-bit version of ClamAV 0.98.7 on my Solaris 10 SPARC server. I have a selection of files all containing the eicar signature but clamd is only picking up the signature in the files <2GB. I have the following set in clamd.conf, to remove file size checking: MaxScanSize 0... (4 Replies)
Discussion started by: Troutfest
4 Replies

2. Shell Programming and Scripting

Max size directory

Hi I know that a perticular direxctory is cosuming max space . Filesystem 1K-blocks Used Available Use% Mounted on nfsfi02:/vol/fivol2/Dir2/dir 104857600 92671400 12186200 89% /fs/dir I want to know which sub directory is consuming max... (4 Replies)
Discussion started by: ptappeta
4 Replies

3. Shell Programming and Scripting

finding max size

Hi I have a list of 2000 records with multiple entries and I want to get the max size for each entry ABC 1 ABC 2 ABC 3 ABC 4 DEF 1 DEF 2 DEF 2 DEF 2 DEF 2 ... (9 Replies)
Discussion started by: Diya123
9 Replies

4. UNIX for Dummies Questions & Answers

MAX file size limited to 2GB

Hi All, We are running HP rp7400 box with hpux 11iv1. Recently, we changed 3 kernel parameters a) msgseg from 32560 to 32767 b) msgmnb from 65536 to 65535 c) msgssz from 128 to 256 Then we noticed that all application debug file size increase upto 2GB then it stops. So far we did not... (1 Reply)
Discussion started by: mhbd
1 Replies

5. UNIX for Advanced & Expert Users

Max. file size

i want to know what is the maximum file size supported by linux with ext3 file system. (1 Reply)
Discussion started by: nagalenoj
1 Replies

6. Solaris

max. size of file

I wants to ask that what is the max size of file that we can create in the unix file system. (2 Replies)
Discussion started by: sameerghogre
2 Replies

7. UNIX for Advanced & Expert Users

How to determine the max file size

Does anyone know a way to determine the maximum filesize on a file system on Solaris, HP-UX, AIX, Linux, and OSF1 using the command line? TIA (2 Replies)
Discussion started by: dknight
2 Replies

8. Programming

Max file size can't exceed 2 GB

We have Sun OS 5.9 we are doing a backup process (ProC program) that uses the function... fprintf(fp,"%s;%s;%s;%s;%s;%ld;%ld;%ld;%ld;%s;%s;%s;%d;%s;%s;%s;%ld;%s;%s;%s;%ld;%ld;%s;%ld;%s;%ld;%s;%s;%c%c",x_contrno, x_subno, x_b_subno,x_transdate,x_last_traffic_date,BillAmt_s, x_billamount_int,... (10 Replies)
Discussion started by: atiato
10 Replies

9. UNIX for Dummies Questions & Answers

Max I/O Size

My HP-UX 11.0 system is supporting an Oracle database. I have found a number of references on the Net to the "Max I/O size" in relation to setting Oracle parameters. How can I tell what my max i/o size is? I originally made the assumption that it was referring to my stripe size but now I think... (1 Reply)
Discussion started by: keelba
1 Replies

10. Shell Programming and Scripting

setting max log file size...

Hello all! I have found a new home, this place is great! I have been searching for days to find a way to set a max size for a log.txt file using a cron job exicuting a shell script. Is it possible for a script to remove older entries in a log file to maintain a limited file size? If so,... (5 Replies)
Discussion started by: v-rod
5 Replies
Login or Register to Ask a Question