i can delet the file i want using
but this delete all wav file i want it deletes just wav files older than 45days automaticallyCode:find /var/spool/asterisk/monitor/ -iname '*.wav' -ctime +45 -exec rm -f {} \;
i can delet the file i want using
but this delete all wav file i want it deletes just wav files older than 45days automaticallyCode:find /var/spool/asterisk/monitor/ -iname '*.wav' -ctime +45 -exec rm -f {} \;
Code:#!/bin/bash ago=$(date +%Y-%m-%d '--date=45 days ago') file="/tmp/file.$$" touch --date $ago "$file" find /path/to/dest/ -type f -newer "$file" ### To delete use following syntax ### ### find /path/to/dest/ -type f -newer "$file" -delete ### ### find /var/spool/asterisk/monitor/ -type f -iname "*.wav" -newer "$file" -delete rm -f "$file"
All [Solved] threads are closed by mods / admin to avoid spam issues. See Howto mark a thread as [Solved]
is following enough ? (to delete wav files older than 45days in /var/spool/asterisk/monitor/)
Code:#!/bin/bash ago=$(date +%Y-%m-%d '--date=45 days ago') file="/tmp/file.$$" touch --date $ago "$file" find /path/to/dest/ -type f -newer "$file" find /var/spool/asterisk/monitor/ -type f -iname "*.wav" -newer "$file" -delete rm -f "$file"
Last edited by zodehala; 5th February 2012 at 12:56 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)