Sponsored Content
Top Forums Shell Programming and Scripting Finding files older than the current date and time and renaming and moving Post 302260372 by jim mcnamara on Thursday 20th of November 2008 10:22:40 AM
Old 11-20-2008
Are you sure you stated the requirement correctly. By definition, any file that exists in a directory has to be older than "now", even if it is still open for writing. But here is a way to find files older then a certain time/date - use
Code:
touch -t yyyymmmddhhmmss dummy
find /path/to/files ! -newer dummy -type f

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Renaming files to have date/time in filename

I have a program that will export my data to a single file, but it assigns a file name that is overridden every time I run the program. I need to change the file name to have a sequential number in the filename. How do I rename a file so that the filename contains the system date and time. I want... (5 Replies)
Discussion started by: wayneb
5 Replies

2. Shell Programming and Scripting

moving and renaming multiple files

Greetings, I know i can use the mv command to move and rename one file. How can I do this with multiple files? example pic01.bmp to pic0001.bmp how can i perform this function on an entire directory of sequential files and keep them in sequence? Hints, suggestions are most welcome:) ... (1 Reply)
Discussion started by: rocinante
1 Replies

3. Shell Programming and Scripting

how to check whether the given file is 5 weeks older than current date

HI, I need to check whether the given file is 5 weeks older than current date ?? Can anyone give me the script for this ?? (1 Reply)
Discussion started by: risshanth
1 Replies

4. Shell Programming and Scripting

Renaming of multiple files with current date

Hi, I have a fixed 4 files in each different directory. The total 17 directories are there each one having 4 files inside it. I need rename all of them with current date. The files formates will be as below: Folder1: abc_NOR_xyz_ddmmyyyy.txt abc_NOR_ghij_ddmmyyyy.txt Folder2:... (5 Replies)
Discussion started by: rjanardhan83
5 Replies

5. Shell Programming and Scripting

Complex renaming then moving files

I am a biologist and using an program on a computer cluster that generates a lot of data. The program creates a directory named ExperimentX (where X is a number) that contains files "out.pdb" and "log.txt". I would like to create a script that renames the out.pdb file to out_ExperimentX.pdb (or... (1 Reply)
Discussion started by: yaledocker
1 Replies

6. UNIX for Dummies Questions & Answers

Adding hours and minutes to current date (Only to date not to time)

Hi, I want to add some hours and minutes to the current date. For example, if the current date is "July 16, 2012 15:20", i want to add 5 hours 30 minutes to "July 16, 2012 00:00" not to "July 16, 2012 15:20". Please help. Thanks! (4 Replies)
Discussion started by: manojgarg
4 Replies

7. Shell Programming and Scripting

Displaying current date time of EDT in IST time

Hi Folks, My server time is in EDT. And i am sending automated mails from that server in which i need to display the current date time as per IST (GMT+5:30). Please advice how to display the date time as per IST. IST time leads 9:30 mins to EDT. and i wrote something like below. ... (6 Replies)
Discussion started by: Showdown
6 Replies

8. Shell Programming and Scripting

WHM Crontab and Folder Renaming to current date

Hello, i am trying to rename a folder named 'cpbackup' to current date in our WHM Root via setting up a cronetab entry. but the folder does not get renamed on the scheduled time :confused: */1 * * * * timestamp=$(date +%m%d%Y);/bin/mv /ac_backups/cpbackup /ac_backups/$timestamp (4 Replies)
Discussion started by: kandyjet
4 Replies

9. UNIX for Dummies Questions & Answers

Moving and renaming files

I have a directory full of directories, say called A B C D E .... In each of these directories there are files called 1.dsp 2.dsp 3.dsp ..... along with others (with different extensions) I need to go through each of these directories and move the dsp file to another folder, but with the name now... (6 Replies)
Discussion started by: claire.a
6 Replies

10. UNIX for Beginners Questions & Answers

Subscribers with Date 90 days older than current date

I have to display only those subscribers which are in "unconnected state" and the date is 90 days older than today's date. Below command is used for this purpose: cat vfsubscriber_20170817.csv | sed -e 's/^"//' -e '1d' | nawk -F '",' '{if ( (substr($11,2,4) == 2017) && ( substr($11,2,8) -lt... (1 Reply)
Discussion started by: dia
1 Replies
DUMMY-UPS(8)							    NUT Manual							      DUMMY-UPS(8)

NAME
dummy-ups - Driver for multi-purpose UPS emulation NOTE
This man page only documents the specific features of the dummy-ups driver. For information about the core driver, see nutupsdrv(8). DESCRIPTION
This program is a multi-purpose UPS emulation tool. Its behavior depends on the running mode: Dummy Mode dummy-ups looks like a standard device driver to upsd(8) and allows one to change any value for testing purposes. It is both interactive, controllable through the upsrw(1) and upscmd(1) commands (or equivalent graphical tool), and batchable through script files. It can be configured, launched and used as any other real driver. This mode is mostly useful for development and testing purposes. Repeater Mode dummy-ups acts as a NUT client, simply forwarding data. This can be useful for supervision purposes. This can also allow some load sharing between several UPS instances, using a point-to-point communication with the UPS. IMPLEMENTATION
The port specification depends on the running mode, and allows the driver to select the right mode. Dummy Mode Port is a definition file name for dummy-ups. This can either be an absolute or a relative path name. In the latter case the NUT sysconfig directory (ie /etc/nut, /usr/local/ups/etc, ...) is prepended. For instance: [dummy] driver = dummy-ups port = evolution500.dev desc = "dummy-ups in dummy mode" This file is generally named "something.dev". It contains a list of all valid data and associated values, and has the same format as an upsc(8) dump (<varname>: <value>). So you can easily create definition files from an existing UPS using "upsc > file.dev". It can also be empty, in which case only a basic set of data is available: device., driver., ups.mfr, ups.model, ups.status Samples definition files are available in the "data" directory of the nut source tree, and generally in the sysconfig directory of your system distribution. Since dummy-ups will loop on reading this file, you can dynamically modify it to interact with the driver. This will avoid message spam into your system log files, if you are using NUT default configuration. You can also use the "TIMER <seconds>" instruction to create scheduled events sequences. For example, the following sequence will loop on switching ups.status between "OL", "OB" and "OB LB" every minute: ups.status: OL TIMER 60 ups.status: OB TIMER 60 ups.status: LB TIMER 60 It is wise to end the script with a TIMER. Otherwise dummy-ups will directly go back to the beginning of the file. Repeater Mode Port is the name of a remote UPS, using the NUT form, ie: <upsname>[@<hostname>[:<port>]] For instance: [repeater] driver = dummy-ups port = ups@hostname desc = "dummy-ups in repeater mode" INTERACTION
Once the driver is loaded in dummy mode, you can change any variables, except those of the driver.* and server.* collections. You can do this by either editing the definition file, or use the upsrw(1) and upscmd(1) commands. Note that in simulation mode, new variables can be added on the fly, by adding these to the definition file. Conversely, if you need to remove variable (such as transient ones, like ups.alarm), simply update these by setting an empty value. As a result, they will get removed from the data. In repeater mode, the driver acts according to the capabilities of the UPS, and so support the same instant commands and settable values. BACKGROUND
This driver was written in one evening to replace the previous dummycons testing driver. It was too limited and required to work from a terminal to interact. dummy-ups is useful for NUT client development, and other testing purpose. It also helps the NUT Quality Assurance effort, by automating some tests on the NUT framework. It now offers a repeater mode. This will help in building the Meta UPS approach, which allows one to build a virtual device, composed of several other devices (either UPS, PDUs). BUGS
Instant commands are not yet supported in Dummy Mode, and data need name/value checking enforcement, as well as boundaries or enumeration definition. AUTHOR
Arnaud Quette SEE ALSO
upscmd(1), upsrw(1), ups.conf(5), nutupsdrv(8) Internet Resources: The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ Network UPS Tools 05/21/2012 DUMMY-UPS(8)
All times are GMT -4. The time now is 11:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy