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
Of
course it is possible. Don't be ridiculous.
Sorry, I couldn't resist stealing a line from an old TV sitcom.
On a GNU system, the following script should work.
#!/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