09-29-2005
successive file renaming & overwriting
Hi all,
In our webserver customer wants to see the latest 10 files arrived. So the names are hardcoded in webpage like :
filename_01.txt
filename_02.txt
....
....
filename_10.txt
where the filename_01.txt is the latest one (typically the output of ls -1t) in the /../webpage directory.
I will have to schedule a daemon/cron job that picks new incoming files from directory /../land (both are in same server) - filename are standard - say new_file_ddmmyy and move to /../webpage directory.
Now the latest moved file will be renamed to filename_01.txt.
the old filename_01.txt will be renamed to filename_02.txt
and so on.
this will be a dynamic script.
Any idea/algorithm/logic/script will help me a lot.
Thanks in advance.
~
sabya
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How to overwrite every time a particular portion of a file?
---------- Post updated at 02:16 PM ---------- Previous update was at 02:07 PM ----------
I have a file whose contents are something like:
Output of "apachectl fullstatus" command:
---------------------------------------------... (3 Replies)
Discussion started by: proactiveaditya
3 Replies
2. Programming
Hi ,
i have two basic requirement on linux platform . I am using C language to do this .
1) copying one file to another (assuming i know their file descriptors)
2) Overwriting a file using it file descriptor .
Please guide.
regards
Aki (2 Replies)
Discussion started by: meet123321
2 Replies
3. Linux
Long story short, there was some sort of corruption with my ide and the script I was working on has been over written with nothing (the file is blank now). The IDE doesn't store a back up from what I know (I'm using notepadd++ in wine lol I know I know I'm addictted to the nppftp sidebar and geany... (1 Reply)
Discussion started by: noPermissions
1 Replies
4. UNIX Desktop Questions & Answers
I have loads of files in different directories which I do miner changed on them and till now I have to create totally new directories for them, specially as I deal with a whole directory at once :wall::wall::wall::wall:
it creates such as mess really
e.g.
FILES="F1/*"
for X in $FILES
do... (2 Replies)
Discussion started by: A-V
2 Replies
5. Shell Programming and Scripting
hello
does someone want to help me for this one ?
i want to rename files & a folder according to the similarities in filenames
for example :
the file with the good name
cglogo tougl1953 dgmel bogd 01 -- ttgductoog ggdté gollogtd.ext1the others files needed to be renamed
cglogo... (5 Replies)
Discussion started by: mc2z674gj
5 Replies
6. Shell Programming and Scripting
NB! I have already started a thread on this subject on ComputerHope (with the thread title "Recursive File Renaming & Logical Sorting"). However, on ComputerHope they are perhaps more specialized in Windows Command Prompt, and not that much in shell scripts for Bash (I guess).
I have a bulk... (1 Reply)
Discussion started by: JewzeyfGhewbelz
1 Replies
7. Shell Programming and Scripting
I have a script, which runs through cronjob every night 9 PM. It is supposed to do following tasks --
1- Connect to ftp.testsite.com via user redtest
2- Fetch file red_bill.txt to my local server, where my script is residing.
3- Rename red_bill.txt to red_bill.V01.txt everyday on sftp server.... (4 Replies)
Discussion started by: solaris_1977
4 Replies
8. Shell Programming and Scripting
Hi, An application is transferring a file to linux system with same file name. As file is transferring with same name always file will be overwritten. In this case we want to know what times file was overwirtten like below.
Modify: 2014-05-12 00:52:01.000000000
Modify: 2014-05-12... (2 Replies)
Discussion started by: Satyak
2 Replies
9. Shell Programming and Scripting
hi
i have a file as in follwoing:
cat apple.txt
Apple is a fruit
But this fruit is costly
Now I used the sed command and i see output as in following
# sed 's/fruit/healthy &/' fruit.txt
Apple is a healthy fruit
But this healthy fruit is costly
#
sed works fine here. But... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies
10. Shell Programming and Scripting
Hello,
I have been working on script in which search and replace the multiple pattern.
1. update_params.sh read the multiple pattern from input file ParamMapping.txt(old_entry|New_entry) and passing this values one by one to change_text.sh
2. change_text.sh read... (0 Replies)
Discussion started by: ketanraut
0 Replies
LEARN ABOUT DEBIAN
get-iab
GET-IAB(1) General Commands Manual GET-IAB(1)
NAME
get-iab - Fetch the arp-scan IAB file from the IEEE website
SYNOPSIS
get-iab [options]
DESCRIPTION
get-iab fetches the Ethernet IAB file from the IEEE website, and saves it in the format used by arp-scan.
The IAB file contains all of the IABs (Individual Address Blocks) that have been registered with IEEE. Each IAB entry in the file speci-
fies the first 36-bits of the 48-bit Ethernet hardware address, leaving the remaining 12-bits for use by the registering organisation. For
example the IAB entry "0050C2003", registered to Microsoft, applies to any Ethernet hardware address from 00:50:c2:00:30:00 to
00:50:c2:00:3f:ff inclusive. Each IAB assignment represents a total of 2^12 (4,096) Ethernet addresses.
Major Ethernet hardware vendors typically use an OUI registration rather than an IAB registration. See get-oui(1) for details.
This script can be used to update the arp-scan IAB file from the latest data on the IEEE website. It is relatively rare to see Ethernet
addresses from IAB registrations, so the IAB file is not as important as the OUI file.
The IAB data is fetched from the URL http://standards.ieee.org/regauth/oui/iab.txt and the output file is saved to the file ieee-iab.txt in
the current directory. The URL to fetch the data from can be changed with the -u option, and the output file name can be changed with the
-f option.
The ieee-iab.txt file that is produced by this script is used by arp-scan to determine the Ethernet card vendor from its hardware address.
The directory that arp-scan will look for the ieee-iab.txt file depends on the options used when it was built. If it was built using the
default options, then it will look in /usr/local/share/arp-scan.
OPTIONS
-h Display a brief usage message and exit.
-f <fn>
Write the output to the specified file instead of the default ieee-iab.txt.
-u <URL>
Use the specified URL to fetch the raw IAB data from instead of the default http://standards.ieee.org/regauth/oui/iab.txt
-v Display verbose progress messages.
FILES
ieee-iab.txt
The default output file.
EXAMPLES
$ get-iab -v
Renaming ieee-iab.txt to ieee-iab.txt.bak
Fetching IAB data from http://standards.ieee.org/regauth/oui/iab.txt
Fetched 230786 bytes
Opening output file ieee-iab.txt
1535 IAB entries written to file ieee-iab.txt
NOTES
get-iab is implemented in Perl, so you need to have the Perl interpreter installed on your system to use it.
get-iab uses the LWP::Simple Perl module to fetch the data from the IEEE website. You must have this module installed on your system for it
to work. This module is available on most distributions, often called libwww-perl. It is also available in source form from CPAN.
You can use a proxy server by defining the http_proxy environment variable.
AUTHOR
Roy Hills <Roy.Hills@nta-monitor.com>
SEE ALSO
arp-scan(1)
get-oui(1)
arp-fingerprint(1)
http://www.nta-monitor.com/wiki/ The arp-scan wiki page.
March 30, 2007 GET-IAB(1)