Sponsored Content
Top Forums Shell Programming and Scripting Automatic name file with increase Post 302119225 by ghostdog74 on Tuesday 29th of May 2007 12:29:41 AM
Old 05-29-2007
Quote:
Originally Posted by lorcan
Aigles, Just a small correction in your code,
to get the latest file we have to sort based on the time,

so the 4th line should have been like

Code:
last_file=$(ls -t1 $filename.$datestamp.* 2>/dev/null | tail -1)

normally if used with tail -1, we would want ls -1tr instead. however for this particular case,i think because the filenames are already timestamped , with a number at the back, when doing ls -1, its still "sorted" to latest file.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

unix automatic file transfer

Hello, I am a beginner with korn shell scripting. I have got a text file that gets produced every night and I need to transfer it to a windows shared area. Is there any command line script (e.g FTP) that I could use to transfer the file automatically without manual intervention everyday? Any... (4 Replies)
Discussion started by: tagem
4 Replies

2. UNIX for Dummies Questions & Answers

File increase

Sorry im really new here this is my second post today! My question is, im trying to write a script and i want to output to a text file but i want each text file to be different so for instance log.txt, log1.txt, log2.txt ect how would i do that? (7 Replies)
Discussion started by: chapmana
7 Replies

3. UNIX for Dummies Questions & Answers

automatic tar xf of file with unknown name

Hi all, With curl I can fetch a tar archive from a web server which contains a file ending with .scf which I am interested in. Unfortunately the file name may vary and the subdirectory inside the tar archive may change. I can manually browse the directory structure and extract the file and then... (3 Replies)
Discussion started by: tkrahn
3 Replies

4. Solaris

Script for automatic count the file i have

Hi I have a folder will all the file ftp in everyday. I have to go in every morning to check to see everynight have all the 2000+ file have been all FTP in. so every morning i will check like this # ls -l *_20080904*_20080904* |wc if there is 2714 that mean is correct. File name:... (13 Replies)
Discussion started by: summerpeh
13 Replies

5. Shell Programming and Scripting

[code] Automatic File Input

i have got many files like this in my folder temp(say) imp_02042008.txt for date 02-04-2008 imp_03092009.txt for date 03-09-2009 imp_25112009.txt for date 25-11-2009 ................... ........ in some folder. and one of my shell code uses one of the above files based on date.... (0 Replies)
Discussion started by: Maruti
0 Replies

6. Shell Programming and Scripting

Automatic file input to code

i have got many files like this in my folder temp(say) imp_02042008.txt for date 02-04-2008 imp_03092009.txt for date 03-09-2009 imp_25112009.txt for date 25-11-2009 ................... ........ in some folder. and one of my shell code uses one of the above files based on date.... (9 Replies)
Discussion started by: Maruti
9 Replies

7. Solaris

how to increase file size in solaris 10 os

hi, let me know how to increase file size in solaris 10 OS (4 Replies)
Discussion started by: meet2muneer
4 Replies

8. UNIX for Advanced & Expert Users

Automatic File Patching

Hi All, I have a query regarding the automatic patching on files in unix Suppose I have a file names - abc.txt and I take its backup as abc.txt_bkp and then do some changes in abc.txt and save it as abc.txt_new. Now I want to automatically apply the changes done on abc.txt to... (0 Replies)
Discussion started by: Shubham Aggarwa
0 Replies

9. Shell Programming and Scripting

Create a specific bash to increase the automatic update on my pi

hi everyone, I just began to be interested about the bash access. I buy a time ago a Raspberry pi, I installed raspbmc and now I would like build a bash to copy everyday all new files inside my server directly on the hard drive in my Pi. So my HDD is directly plug on my pi with usb connect,... (4 Replies)
Discussion started by: nagito34
4 Replies

10. UNIX for Beginners Questions & Answers

Automatic file movement between folders

Hello There, Here is the use cases Input folders dropbox/project/abc/ dropbox/project/pqr/ dropbox/project/lmn/ dropbox/project/xyz/ Target Folders /data/abc/ /data/pqr/ /data/lmn/ /data/xyz/ (2 Replies)
Discussion started by: TreasureCookies
2 Replies
quotacheck(8)						      System Manager's Manual						     quotacheck(8)

Name
       quotacheck - file system quota consistency checker

Syntax
       /etc/quotacheck [ -v ] [ -f ] filesystem ...
       /etc/quotacheck [ -v ] -a

Description
       The  command examines each file system, builds a table of current disc usage, and compares this table against that stored in the disc quota
       file for the file system.  If detects any inconsistencies, it updates both the quota file and the current system copies	of  the  incorrect
       quotas.	Inconsistencies occur only if an active file system is checked.

       Normally,  returns a warning if it cannot find a valid quota file.  If you use the option, creates a quota file automatically and then per-
       forms its normal functions.

       If you use the flag in place of any file system name, checks all the file systems listed in to be read-write with disc quotas.

       Normally reports only modified quotas. If the option is supplied, will indicate the calculated disc quotas for each user  on  a	particular
       file system.

       The  command  expects each file system to be checked to have a quota file named in the root directory.  If none is present, will ignore the
       file system.

       The command is normally run at boot time from the file, before enabling disc quotas with For further information, see

       The command accesses the raw device in calculating the actual disc usage for each user.	Thus, the file systems checked should be quiescent
       while is running.

Files
       Default file systems

See Also
       quota(2), setquota(2), quotaon(8)
       ``Disk Quotas in a UNIX Environment,'' ULTRIX Supplementary Documents, Volume 3: System Manager

																     quotacheck(8)
All times are GMT -4. The time now is 01:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy