Sponsored Content
Full Discussion: Files delete script
Top Forums Shell Programming and Scripting Files delete script Post 302910743 by fop4658 on Monday 28th of July 2014 01:40:59 AM
Old 07-28-2014
hello Don,

Sorry for my question not being clear. Apologize for the confusion here, as my script requirement changed so we can skip all the questions in your comments.

When I ran the script for testing now, its actually displaying "Files Deleted" for every file deleted. However, I want my script to display "Files Deleted" only once after successful deletion of all files. Below is output I get now for every file deleted.

Code:
Files Deleted
Files Deleted
Files Deleted
Files Deleted
Files Deleted

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to delete files

hi guys, i need a script to delete files that have core in their name ...it might be part of the file name or as a .core extension ...any file that has core as its extension.... i am only able to delete files which just have thier name as core using this : find $1 -type f -name "core"... (12 Replies)
Discussion started by: vats
12 Replies

2. Shell Programming and Scripting

script to delete files

I have 1000 directories named: 0 - 999 which should contain 1000 files named 0 - 999. But some of these directories contain file whose names are greater than 999 and I need to delete those. I wrote the script below but that doesnt work. Any ideas? #!/bin/bash DIRS=999 for (( j = 0 ; j <... (3 Replies)
Discussion started by: looza
3 Replies

3. Shell Programming and Scripting

perl script to check if empty files are created and delete them and run a shell script

I have a local linux machine in which the files are dumped by a remote ubuntu server. If the process in remote server has any problem then empty files are created in local machine. Is there any way using perl script to check if the empty files are being created and delete them and then run a shell... (2 Replies)
Discussion started by: hussa1n
2 Replies

4. Shell Programming and Scripting

Script to delete files

Hi, I am looking for a BASH script that deletes old files except the last three recent ones. (8 Replies)
Discussion started by: newuser_25
8 Replies

5. UNIX for Dummies Questions & Answers

script to delete old files

Hi, I want to delete files that are older than 60 days.... i need to execute the script in 7 differnt folders.... i can run the script in crontab to regularly check.... I am struck @ finding out how the file is 60 days old or not... Can u please help me on this? Thanks, NithZ (6 Replies)
Discussion started by: Nithz
6 Replies

6. Shell Programming and Scripting

Need help creating a script to FTP files to a server and then delete the files that were transfered.

I am trying to FTP files to a Windows server through my Linux machine. I have setup the file transfer with no problems but am having problem deleting those files from the Linux box. My current non-working solution is below. Any ideas, anyone?? :wall: Please be gentle, I'm fairly new to this... (4 Replies)
Discussion started by: jmalfhs
4 Replies

7. Shell Programming and Scripting

Need script to delete old files

Hi, I need a script to delete files older than 2 years or a year. I have around hundreds of old files which needs to be deleted. Could you please help. (2 Replies)
Discussion started by: sv0081493
2 Replies

8. HP-UX

Need help to create a script to delete the files

Hi All, I want to delete all core* files in below file system in Unix server. File system: /usr/sap/P01/JC00/j2ee/cluster/server0 I want to setup a cron job every ten minutes to delete the core *files Thanks N Rao (2 Replies)
Discussion started by: YNRao24
2 Replies

9. Shell Programming and Scripting

Script to SFTP files then delete them.

Hi, I want to create a script.sh over my local server doing the following: 1- There are files are creating over a directory over my local server "DIR_1". 2- I need to SFTP transfer these files to another Host "HOST_1" by "USER_1"/ "PASS_1". 3- Then Delete the transferred files from my Local... (2 Replies)
Discussion started by: eng_galileo
2 Replies

10. Shell Programming and Scripting

Script needed to delete to the list of files in a directory based on last created & delete them

Hi My directory structure is as below. dir1, dir2, dir3 I have the list of files to be deleted in the below path as below. /staging/retain_for_2years/Cleanup/log $ ls -lrt total 0 drwxr-xr-x 2 nobody nobody 256 Mar 01 16:15 01-MAR-2015_SPDBS2 drwxr-xr-x 2 root ... (2 Replies)
Discussion started by: prasadn
2 Replies
Net::DRI::Logging::Files(3pm)				User Contributed Perl Documentation			     Net::DRI::Logging::Files(3pm)

NAME
Net::DRI::Logging::Files - Logging to Files for Net::DRI VERSION
This documentation refers to Net::DRI::Logging::Files version 1.01 SYNOPSIS
See Net::DRI::Logging DESCRIPTION
This class dumps all logging information to various files. EXAMPLES
$dri->new({..., logging => ['files',{output_directory => '/tmp'}] ,...}); If not defined, output_directory defaults to the current working directory. SUBROUTINES
/METHODS All mandated by superclass Net::DRI::Logging. DIAGNOSTICS
None. CONFIGURATION AND ENVIRONMENT
None. DEPENDENCIES
This modules has to be used inside the Net::DRI framework and needs the following components: Net::DRI::Logging It also uses IO::Handle, from Perl core. INCOMPATIBILITIES
None BUGS AND LIMITATIONS
No known bugs. Please report problems to author (see below) or use CPAN RT system. Patches are welcome. SUPPORT
For now, support questions should be sent to: <netdri@dotandco.com> Please also see the SUPPORT file in the distribution. SEE ALSO
<http://www.dotandco.com/services/software/Net-DRI/> AUTHOR
Patrick Mevzek, <netdri@dotandco.com> LICENSE AND COPYRIGHT
Copyright (c) 2009,2010 Patrick Mevzek <netdri@dotandco.com>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. See the LICENSE file that comes with this distribution for more details. perl v5.10.1 2010-03-25 Net::DRI::Logging::Files(3pm)
All times are GMT -4. The time now is 12:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy