Sponsored Content
Top Forums Shell Programming and Scripting How to delete directories and files with xargs? Post 302903356 by steiner on Tuesday 27th of May 2014 05:37:54 AM
Old 05-27-2014
Hello,


yes i have an output of lot of files.

but i need also to delete dire tories that are older than one day.
That is no optimize the inodes for the disk

Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

delete pattern files in sub directories

Hello friends, I am compiling some set of SQL scripts in a set of sub directories demoed as below. After compiling log files are being created. Each and every time after compiling time I had to go subdir by subdir to delete the log files. I am sure there should be simple way to look for all log... (4 Replies)
Discussion started by: adurga
4 Replies

2. Shell Programming and Scripting

A Batch job to delete files from various directories

Hi, I have a shell script to find files older than 'X' days ($2) in directory path ($1) and delete them. Like this: my_file_remover.sh /usr/home/c 90 Now, I need to modify this script and add it in CRON, so that it checks other directories also. Like: my_file_remover.sh /usr/home/c... (3 Replies)
Discussion started by: guruparan18
3 Replies

3. Shell Programming and Scripting

Search directories for files with zero sizes to delete

Hi, I am trying to write a script that will use ls on a directory and list the files one at a time and their size. If the size is 0 i want it to ask me if I want to delete it (yes or no). If I say yes, I want it to delete but it won't know what the file name is just from running from the script.... (2 Replies)
Discussion started by: akeenabawa
2 Replies

4. Shell Programming and Scripting

Delete files from sub-directories over 7 days

Can any one please help me in deleting all the Files over 7 days from sub-directories A, B, C... Top-Directory Sub-Directory-A File-1 File-2 ..... File-n Sub-Directory-B File-1 File-2 ..... File-n Sub-Directory-C File-1 ... (1 Reply)
Discussion started by: sureshcisco
1 Replies

5. Red Hat

Find files older than 30 days in directories and delete them

Hi, I have dummies questions: My script here can find the files in any directories older than 30 days then it will delete the files but not the directories. I would like to also be able to delete the directories that hold old files more than 30 days not just the files itself. find . -type f... (2 Replies)
Discussion started by: lamoul
2 Replies

6. Homework & Coursework Questions

Find and delete empty files and directories

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Need to make a script, to remove all empty files and folders from current category. It also should show the name... (2 Replies)
Discussion started by: Itixop
2 Replies

7. Shell Programming and Scripting

Script to go Into Directories and Find/Delete files

I have a task, I usually do manually, but with growing responsibilities I tend to forget to do this weekly, I want to write a script that automates this, but I cant seem to work it out in my head, I have the shell of it out, but need help, and you guys have helped me with EVERY problem I have... (5 Replies)
Discussion started by: gkelly1117
5 Replies

8. Shell Programming and Scripting

Delete files in group of directories

OS: SUNOS 5.10 i386 Hello guys I wrote a shell script in bash shell to delete the files less than 30 days old. The following is the script. ======================================= #!/bin/bash for dirs in `/clu04/oracle/directory_list.lst` do find $dirs -type f -mtime -30 -exec rm {} \;... (3 Replies)
Discussion started by: zacsparrow
3 Replies

9. Shell Programming and Scripting

How to delete all the files and folders inside all the directories except some specific directory?

hi, i have a requirement to delete all the files from all the directories except some specific directories like archive and log. for example: there are following directories such as A B C D Archive E Log F which contains some sub directories and files. The requirement is to delete all the... (7 Replies)
Discussion started by: Little
7 Replies

10. UNIX for Beginners Questions & Answers

Delete Directories and its files that begin with the same character string

I wrote a shell script program that supposed to delete any directories and its files that begin with the same character string . The program is designed to delete directories and its files that are one day old or less and only the directories that begin with the same character string. The problem... (1 Reply)
Discussion started by: dellanicholson
1 Replies
vxupgrade(1M)															     vxupgrade(1M)

NAME
vxupgrade - upgrade the disk layout of a mounted VxFS file system SYNOPSIS
new_version] rawdev] mount_point DESCRIPTION
prints the current disk layout version number for a VxFS file system or upgrades the file system to a new disk layout. operates on file systems mounted for read/write access: mount_point must be a mounted VxFS file system. You cannot upgrade directly from the oldest disk layout version to the newest disk layout version; you must upgrade to the next level disk layout first. You cannot upgrade directly from the oldest disk layout version to the newest disk layout version; you must upgrade to the next level disk layout first. Only a privileged user can query or upgrade a VxFS file system. When invoked with the option, upgrades the disk layout to the specified version. When invoked without the option, prints the disk layout version number of the file system. To perform an upgrade, freezes the file system, allocates and initializes the new structures, frees the space used by the old structures, and then thaws the file system. This process should not keep the file system frozen for more than a few seconds. employs a lock file on the file system to ensure that only one instance of is running at any time. and cannot run simultaneously, so the lock file also ensures that does not run while a file system reorganization is in progress. When is invoked for an upgrade, it opens the lock file in the root of the file system specified by mount_point. If the lock file doesn't exist, it is created. The fcntl(2) system call is used to obtain a write lock on the file. If the write lock fails, fails, assuming that another or an is running. NOTES Disk layout versions cannot be downgraded. Upgrading to disk layout Version 6 changes all inodes in the file system. A file system with disk layout Version 5 can be mounted and upgraded to Version 6 disk layout. To upgrade from Version 4 disk layout to Version 6, you must upgrade to Version 5 first. This requires two separate invocations of the The upgrade may fail due to lack of free space at each step (see below). Optionally, prior to upgrading a file system to disk layout Version 6, delete all existing Storage Checkpoints. A Storage Checkpoint cre- ated on a file system with a disk layout prior to Version 6 stores a complete copy of the inodes at the time it was taken. Thus, a file system with one Storage Checkpoint takes approximately twice as long to upgrade as a file system without Storage Checkpoints. Conversely, a Storage Checkpoint created on a file system with disk layout Version 6 or later stores only the inodes of files whose data blocks were modified. As a result, the time required to upgrade the disk layout Version in the future is less affected by the number of Storage Check- points on the file system. DIAGNOSTICS returns an exit value of 0 if the upgrade is successful. returns 1 if the upgrade fails due to insufficient free space, returns 32 if the specified mount point is not a VxFS file system, and returns 2 if the upgrade fails for another reason. Options recognizes the following options: Upgrade disk layout to new_version. new_version can be 5 or 6. Use the pathname rawdev as the raw device. This option can be used when cannot determine which raw device corresponds to the mount_point (when is corrupted, for example). Operands recognizes the following operand: mount_point A mounted VxFS file system. Free Space Requirement requires free space on the file system to perform the upgrade; the upgrade may fail if there is not enough free space. It is difficult to determine the exact amount of space required to upgrade a VxFS file system, however, you can estimate the maximum space required. Typically, upgrading a disk layout Version 4 file system to disk layout Version 5 does not require much extra disk space. The space and time required to complete the upgrade increases with the number of extended attributes or hard links in the file system. Typical maximum space to convert to a Version 6 disk layout is at least two additional inodes with one block for every inode. The number of inodes is the sum total of inodes across all filesets in the file system (see the manual page for information on how to obtain the num- ber of inodes in a fileset). Allow at least ten minutes to upgrade for every million inodes in the file system. To ensure that there are 8K extents available, defragment the file system (see the manual page for information on how to obtain the number of free extents in a file system and how to defragment a file system). You cannot upgrade a Version 4 disk layout to Version 6 directly. You must first upgrade from Version 4 to a Version 5 disk layout, and then upgrade to Version 6. The upgrade may fail due to a lack of space at each step. Once a file system has been upgraded to Version 4, it is no longer mountable on HP-UX 10.01 and 10.10. Once a file system has been upgraded to Version 4, it is no longer mountable on: o HP-UX 10.x o HP-UX 11.0 without JFS 3.3 from Application CD Version 4 file systems are mountable on: o HP-UX 11.0 with JFS 3.3 from Application CD o HP-UX 11.1x o HP-UX 11.2x o HP-UX 11.31 You cannot upgrade the root or file systems to Version 4 on an 11.0 system running JFS 3.3 from the Application CD. Additionally, we do not advise upgrading the or file systems to Version 4 on an 11.0 system. These core file systems are crucial for system recovery. The HP- UX 11.0 kernel and emergency recovery media were built with an older version of JFS that does not recognize the Version 4 disk layout. If these file systems were upgraded to Version 4, your system would fail to boot with the 11.0 kernel as delivered or the emergency recovery media. You can, however, upgrade these core file systems to Version 4 on an HP-UX 11.1x system. Disk layout versions cannot be downgraded, for example, you cannot change a file system from disk layout version 4 to disk layout version 3. A file system cannot be upgraded from a Version 3 disk layout to a Version 4 disk layout if its intent log size is less than 256 kilobytes. After upgrading from a Version 2 disk layout, run to convert the inode format to allow growth beyond a two-gigabyte offset. RETURN VALUE
returns the following values: Successful completion. Upgrade failed due to lack of disk space. Some other error occurred. Specified mount_point is not a VxFS file system. FILES
Lock file External quotas file WARNINGS
The HP-UX 11i boot loader requires the boot filesystem (if a vxfs filesystem) to be on disk layout version 5 or less. The boot file system, usually mounted under or , contains the HP-UX kernel you boot from. You must NOT vxupgrade the boot file system to version 6 or above even though your system is running a VxFS version which supports these newer disk layout versions. Otherwise, your system will be unbootable. When you vxupgrade other core file systems such as , , , , care should be taken to ensure that the OE media for system recovery supports a VxFS version that can recognize the new disk layouts. Otherwise, you may not be able to repair these file systems in a recovery shell. SEE ALSO
fsadm_vxfs(1M), mkfs_vxfs(1M), quotaon(1M), vxfsconvert(1M), fcntl(2), fs_vxfs(4), vxfsio(7). vxupgrade(1M)
All times are GMT -4. The time now is 08:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy