Sponsored Content
Top Forums Shell Programming and Scripting Script To dlete PDF file s and Folders Post 70620 by ved123 on Monday 2nd of May 2005 02:21:53 PM
Old 05-02-2005
Hi guys

even though i am new i tried to put like this

Is this correct

#!/bin/sh
echo "Removing tmp directories and PDF files older than 5 days created by users"
#!/bin/sh
cd /opt/dctm/....Path
echo 'Current Direcotory is' $PWD

"find ./ -name '*.pdf' -mtime +5 >>test.out"

find ./ -type d -mtime +5 -exec rm -R {} \;

find ./ -name '*.pdf' -exec rm '{}' ';'

"find ./ -name '*.pdf' -mtime +5 >>test1.out"

diff test.out,test1.out >> test2.out

mailx -s" Deleted Files For $TODAY at $TIME" xyz.com <test2.out

I am trying to delete folders and pdf files in temp and trying to write before and after and comparing to get deleted files and mailing them.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to check if any file exists in 4 folders

Hi All, working on AIX 5.3. Requirement is: Shell script in ksh to check if any file exists in 4 folders as below: 1. /FILE/INB/INT1 2. /FILE/INB/INT2 3. /FILE/INB/INT3 4. /FILE/INB/INT4 Thanks a lot for your time! a1_win. (3 Replies)
Discussion started by: a1_win
3 Replies

2. Shell Programming and Scripting

Perl - Convert html to pdf - PDF::FromHTML

Hi, I am trying to convert html to pdf using perl module PDF::FromHTML, am getting the error as given below. not well-formed (invalid token) at line 2, column 17, byte 56 at C:/Perl/lib/XML/Parser.pm line 187 at C:/Perl/site/lib/PDF/FromHTML.pm line 140 The perl code is as given... (2 Replies)
Discussion started by: DILEEP410
2 Replies

3. Shell Programming and Scripting

reduce pdf file size through multiple folders

Dear all, i have a lot of .pdf files that i need to reduce size with pdf2ps and ps2pdf app. I need a script which i can reduce file size of all .pdf files in every subfolder of WORKDIR folder. folder tree like: WORKDIR SUBBWORK DIR1 SUB_SUB_WORKDIR1 ... (1 Reply)
Discussion started by: migor78
1 Replies

4. UNIX for Dummies Questions & Answers

Remove file and folders Script

Hi I am trying to modify a script that will remove files and folders under a set directory on my server. I am using the following find /home/test/HM/ -type d -exec rm -rf {} \; 2>/dev/null This removes the files in the HM folder but it also removes the HM folder which i do not want to... (3 Replies)
Discussion started by: treds
3 Replies

5. Shell Programming and Scripting

Shell Script to Dynamically Extract file content based on Parameters from a pdf file

Hi Guru's, I am new to shell scripting. I have a unique requirement: The system generates a single pdf(/tmp/ABC.pdf) file with Invoices for Multiple Customers, the format is something like this: Page1 >> Customer 1 >>Invoice1 + invoice 2 >> Page1 end Page2 >> Customer 2 >>Invoice 3 + Invoice 4... (3 Replies)
Discussion started by: DIps
3 Replies

6. Shell Programming and Scripting

Convert excel file to PDF file using shell script

Hi All, Is it possible to convert the excel file to PDF file(Without loosing any format) using unix shell scripting ??? If yes Kindly help me on the code Thanks in advance!!! (5 Replies)
Discussion started by: Balasankar
5 Replies

7. Shell Programming and Scripting

PDF Script to extract PDF Links MOD in Need

In here we have a script to extract all pdf links from a single page.. any idea's in how make this read instead of a page a list of pages.. and extract all pdf links ? #!/bin/bash # NAME: pdflinkextractor # AUTHOR: Glutanimate (http://askubuntu.com/users/81372/), 2013 #... (1 Reply)
Discussion started by: danielldf
1 Replies

8. Shell Programming and Scripting

Converting secured pdf files to pdf using acroread

Does anybody have idea of Converting secured pdf files to pdf using acroread ? ---------- Post updated at 04:49 PM ---------- Previous update was at 04:44 PM ---------- This file is not password protected. (4 Replies)
Discussion started by: Soham
4 Replies

9. Shell Programming and Scripting

Shell Script for enter folders and join file

Hello everyone. I have a dlink cam that save recordings splitted for hours. Each hour folder contain a lot of small avi files. Repository has the following directories structure: \_20140101/ \_ 01 \_a.avi \_b.avi \_ 02 \_c.avi ... (3 Replies)
Discussion started by: setterx
3 Replies

10. Shell Programming and Scripting

Script to compare files in 2 folders and delete the large file

Hello, my first thread here. I've been searching and fiddling around for about a week and I cannot find a solution.:confused: I have been converting all of my home videos to HEVC and sometimes the files end up smaller and sometimes they don't. I am currently comparing all the video files... (5 Replies)
Discussion started by: Josh52180
5 Replies
All times are GMT -4. The time now is 11:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy