Sponsored Content
Top Forums Shell Programming and Scripting Script needed to delete to the list of files in a directory based on last created & delete them Post 302936956 by RudiC on Monday 2nd of March 2015 08:01:49 AM
Old 03-02-2015
I've never seen a directory structure like dir1, dir2, dir3. Is it more like
Code:
parent_dir/dir1/dir2/dir3/

or
Code:
parent_dir/dir1/
parent_dir/dir2/
parent_dir/dir3/

or even completely different?
And - what content of which files do you need to read?
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sheel script to Delete a set of files from a given directory

I have a file <filestodelete> containing names of files to to be deleted from a directory <filesstore>. I want a script file which accptes the <filestodelete> and also the location of the directory(<filestore>) and deletes all files matching. Thanks in Advance.. (3 Replies)
Discussion started by: VardhiniVenkat
3 Replies

2. Shell Programming and Scripting

Delete files created before specific date.

There is a system logging a huge amount of data and we need to delete some of the older logs .I mean the files that are created before one week from today. Here is a listing of files that are sitting there: /usr/WebSphere/AppServer/logs # ls -l -rw-r--r-- 1 root system 3740694 May... (5 Replies)
Discussion started by: moustafashawky
5 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

Need to delete large set of files (i.e) close to 100K from a directory based on the input file

Hi all, I need a script to delete a large set of files from a directory under / based on an input file and want to redirect errors into separate file. I have already prepared a list of files in the input file. Kndly help me. Thanks, Prash (36 Replies)
Discussion started by: prash358
36 Replies

5. Red Hat

Need Script to ZIP/SAVE & then DELETE Log file & DELETE ZIPS older than 12 months

ENVIROMENT Linux: Fedora Core release 1 (Yarrow) iPlanet: iPlanet-WebServer-Enterprise/6.0SP1 Log Path: /usr/iplanet/servers/https-company/logs I have iPlanet log rotation enabled rotating files on a daily basis. The rotated logs are NOT compressed & are taking up too much space. I... (7 Replies)
Discussion started by: zachs
7 Replies

6. Shell Programming and Scripting

[Solved] Get files & delete them by shell script

I want to use my script to get any file then delete it once it transfers to my side , I manage to create below script to generate "list" file which contains all file names in "10.10.1.1" then I made "a.out" file which contains the commands that I want to run it on "10.10.1.1" to get & delete the... (2 Replies)
Discussion started by: arm
2 Replies

7. UNIX for Advanced & Expert Users

Help with a shell script? List files, delete them and log them

Hello, i'm trying to solve this script. List, one at a time, all files larger than 100K in the /home/username directory tree. Give the user the option to delete or compress the file, then proceed to show the next one. Write to a logfile the names of all deleted files and the deletion times. I... (7 Replies)
Discussion started by: jose2802
7 Replies

8. Shell Programming and Scripting

SFTP Shell Script Get & Delete && Upload & Delete

Hi All, Do you have any sample script, - auto get file from SFTP remote server and delete file in remove server after downloaded. - only download specify filename - auto upload file from local to SFTP remote server and delete local folder file after uploaded - only upload specify filename ... (3 Replies)
Discussion started by: weesiong
3 Replies

9. UNIX for Beginners Questions & Answers

Delete all files created in specific year

I have more than 200K files created in year 2017 under directory having size of 50GB. I want to all these files in one shot. Is there any faster option available with find command to delete all these file ? (6 Replies)
Discussion started by: sp23029
6 Replies
native::Repos(3)					User Contributed Perl Documentation					  native::Repos(3)

NAME
SVN::Repos - Subversion repository functions SYNOPSIS
use SVN::Core; use SVN::Repos; use SVN::Fs; my $repos = SVN::Repos::open('/path/to/repos'); print $repos->fs()->youngest_rev; DESCRIPTION
SVN::Repos wraps the object-oriented "svn_repos_t" functions, providing access to a Subversion repository on the local filesystem. CONSTRUCTORS SVN::Repos::open($path) This function opens an existing repository, and returns an "SVN::Repos" object. create($path, undef, undef, $config, $fs_config) This function creates a new repository, and returns an "SVN::Repos" object. METHODS $repos->dump_fs($dump_fh, $feedback_fh, $start_rev, $end_rev, $incremental, $cancel_func, $cancel_baton) $repos->dump_fs2($dump_fh, $feedback_fh, $start_rev, $end_rev, $incremental, $deltify, $cancel_func, $cancel_baton) Create a dump file of the repository from revision $start_rev to $end_rev , store it into the filehandle $dump_fh, and write feedback on the progress of the operation to filehandle $feedback_fh. If $incremental is TRUE, the first revision dumped will be a diff against the previous revision (usually it looks like a full dump of the tree). If $use_deltas is TRUE, output only node properties which have changed relative to the previous contents, and output text contents as svndiff data against the previous contents. Regardless of how this flag is set, the first revision of a non-incremental dump will be done with full plain text. A dump with @a use_deltas set cannot be loaded by Subversion 1.0.x. According to svn_repos.h, the $cancel_func is a function that is called periodically and given $cancel_baton as a parameter to determine whether the client wishes to cancel the dump. You must supply "undef" at the very least. Example: use SVN::Core; use SVN::Repos; my $repos = SVN::Repos::open ('/repo/sandbox'); open my $fh, ">/tmp/tmp.dump" or die "Cannot open file: $! "; my $start_rev = 10; my $end_rev = 20; my $incremental = 1; my $deltify = 1; $repos->dump_fs2($fh, *STDOUT, # Dump file => $fh, Feedback => STDOUT $start_rev, $end_rev, # Revision Range $incremental, $deltify, # Options undef, undef); # Cancel Function close $fh; $repos->load_fs($dumpfile_fh, $feedback_fh, $uuid_action, $parent_dir, $cancel_func, $cancel_baton); $repos->load_fs2($dumpfile_fh, $feedback_fh, $uuid_action, $parent_dir, $use_pre_commit_hook, $use_post_commit_hook, $cancel_func, $cancel_baton); Loads a dumpfile specified by the $dumpfile_fh filehandle into the repository. If the dumpstream contains copy history that is unavailable in the repository, an error will be thrown. The repository's UUID will be updated iff the dumpstream contains a UUID and $uuid_action is not equal to $SVN::Repos::load_uuid_ignore and either the repository contains no revisions or $uuid_action is equal to $SVN::Repos::load_uuid_force. If the dumpstream contains no UUID, then $uuid_action is ignored and the repository UUID is not touched. If $parent_dir is not null, then the parser will reparent all the loaded nodes, from root to @a parent_dir. The directory $parent_dir must be an existing directory in the repository. If $use_pre_commit_hook is set, call the repository's pre-commit hook before committing each loaded revision. If $use_post_commit_hook is set, call the repository's post-commit hook after committing each loaded revision. If $cancel_func is not NULL, it is called periodically with $cancel_baton as argument to see if the client wishes to cancel the load. You must at least provide undef for these parameters for the method call to work. Example: use SVN::Core; use SVN::Repos; my $repos = SVN::Repos::open ('/repo/test_repo'); open my $fh, "/repo/sandbox.dump" or die "Cannot open file: $! "; my $parent_dir = '/'; my $use_pre_commit_hook = 0; my $use_post_commit_hook = 0; $repos->load_fs2($fh, *STDOUT, $SVN::Repos::load_uuid_ignore, # Ignore uuid $parent_dir, $use_pre_commit_hook, # Use pre-commit hook? $use_post_commit_hook, # Use post-commit hook? undef, undef); close $fh; $repos->fs() Returns the "SVN::Fs" object for this repository. $repos->get_logs([$path, ...], $start, $end, $discover_changed_paths, $strict_node_history, $receiver) Iterates over all the revisions that affect the list of paths passed as the first parameter, starting at $start, and ending at $end. $receiver is called for each change. The arguments to $receiver are: $self The "SVN::Repos" object. $paths "undef" if $discover_changed_paths is false. Otherwise, contains a hash of paths that have changed in this revision. $rev The revision this change occured in. $date The date and time the revision occured. $msg The log message associated with this revision. $pool An "SVN::Pool" object which may be used in the function. If $strict_node_history is true then copies will not be traversed. ADDITIONAL METHODS The following methods work, but are not currently documented in this file. Please consult the svn_repos.h section in the Subversion API for more details. $repos->get_commit_editor(...) $repos->get_commit_editor2(...) $repos->path(...) $repos->db_env(...) $repos->lock_dir(...) $repos->db_lockfile(...) $repos->hook_dir(...) $repos->start_commit_hook(...) $repos->pre_commit_hook(...) $repos->post_commit_hook(...) $repos->pre_revprop_change(...) $repos->post_revprop_change(...) $repos->dated_revision(...) $repos->fs_commit_txn(...) $repos->fs_being_txn_for_commit(...) $repos->fs_being_txn_for_update(...) $repos->fs_change_rev_prop(...) $repos->node_editor(...) $repos->dump_fs(...) $repos->load_fs(...) $repos->get_fs_build_parser(...) AUTHORS
Chia-liang Kao <clkao@clkao.org> COPYRIGHT
Copyright (c) 2003-2006 CollabNet. All rights reserved. This software is licensed as described in the file COPYING, which you should have received as part of this distribution. The terms are also available at http://subversion.tigris.org/license-1.html. If newer versions of this license are posted there, you may use a newer version instead, at your option. This software consists of voluntary contributions made by many individuals. For exact contribution history, see the revision history and logs, available at http://subversion.tigris.org/. perl v5.12.1 2008-03-17 native::Repos(3)
All times are GMT -4. The time now is 08:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy