| | |
Need some help with compression / move script
![]() |
•
•
Join Date: Aug 2007
Posts: 165
Reputation:
Solved Threads: 18
•
•
•
•
like the script blue,
would it be possible to get a script that could then remove the zipped up .dem files after they become 6months in age to keep down the disk space been used?
Would be a useful and great extra
Sorry, I couldn't resist stealing a line from an old TV sitcom.
On a GNU system, the following script should work.
Shell Scripting Syntax (Toggle Plain Text)
#!/bin/bash REP="/var/www/html/hltv/cztv" # Copying directory TMP_PATTERN="/tmp/cztv_pattern" # First, create a file dated 6 months in the past touch -d "6 months ago" ${TMP_PATTERN} # Now find all files in the target directory that are not newer # than the pattern, and delete them. Do NOT descend into # sub-directories (if any) find ${REP}/* -prune ! -newer ${TMP_PATTERN} -exec rm -f {} \; # Finally, delete the pattern rm -f ${TMP_PATTERN}
Warning: this script is not tested. I'm fairly certain the command syntax is correct, though. Test it thoroughly before deploying it!
N
![]() |
Similar Threads
- Zip files, move files, delete source (help me please) (Shell Scripting)
- script for fedora core 4 (Shell Scripting)
- Upload/Download Script... with compression? (PHP)
- I Cannot Delete, Move, or Rename a File On My PC. (Viruses, Spyware and other Nasties)
- Log file rotation script (Perl)
- Minor problem with some script... (C)
- Hotoffers get me mad !! (Viruses, Spyware and other Nasties)
- Bash shell screipt help (Shell Scripting)
- Automating a copy/move (Windows NT / 2000 / XP)
Other Threads in the Shell Scripting Forum
- Previous Thread: "set -o notify" for job runing background in Bash
- Next Thread: hi all please help me in this issue.
| Thread Tools | Search this Thread |






Please specify.