10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Shell Programming and Scripting
I have a qnap TS259 that is running ubuntu. Have successfully setup back scripts that are initiated by cron.
I would like to create a couple scrypts that would operate on the recycle bins for both drives. Just want to be able to run the script manually that would walk through both directories... (13 Replies)
Discussion started by: mackconsult
13 Replies
3. Red Hat
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
4. Shell Programming and Scripting
I need help. I have to create a script which will delete multiple directory (folders) that are two months old. Example, I have folders dated April, May, June and July. I have to delete folders April and May and retain June and July and as such that when the July month lapse, the folder June will be... (2 Replies)
Discussion started by: jasperux
2 Replies
5. Shell Programming and Scripting
To find the whole size of a particular directory i use "du -sk /dirname".. but after finding the direcory's size how do i make conditions like if the size of the dir is more than 1 GB i hav to delete some of the files inside the dir (0 Replies)
Discussion started by: shaal89
0 Replies
6. Shell Programming and Scripting
Hello Community!
Im newbie on shell programming and its my first post.
Im trying to make a bash shell script that it removes files of subdirectory.
it is called : rms -{g|l|b} size1 dir
-g means : remove file or files in dir that is above size1
-l means: remove file or files in dir that... (1 Reply)
Discussion started by: BTKBaaMMM
1 Replies
7. Shell Programming and Scripting
I wrote a script to delete files which are older than "x" days, if the size of the directory is greater than "y"
#!/bin/bash
du -hs $1
while read SIZE ENTRY
do
if ;
then
find $1 -mtime +$2 -exec rm -f {} \;
echo "Files older than $2 days deleted"
else
echo "free Space available"... (4 Replies)
Discussion started by: JamesCarter
4 Replies
8. Shell Programming and Scripting
Hi,
Iam trying to delete 6 months old files.
Iam using the following script
-ctime +190 -type f -exec echo rm {} \;
Iam getting an error saying -ctime not found. (6 Replies)
Discussion started by: Sompalle Jalaja
6 Replies
9. Shell Programming and Scripting
Guys,
My log files stored in the date format format below(log_20080714072942):
TIMESTAMP=`date +%Y%m%d%H%M%S`
LOG=/log/log_${TIMESTAMP}.log
I'm looking for a shell script which deletes all files which is older than 3 months from today.
Regards,
Bhagat (3 Replies)
Discussion started by: bhagat.singh-j
3 Replies
10. UNIX for Dummies Questions & Answers
Hi All,
I have a requirement like below,
I want to transfer few file of size > 5 Mb from one directory to anotehr directory. Please let me know the command how can i do that
Sorry if it looks silly
Senthil (6 Replies)
Discussion started by: skcontact
6 Replies