[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] Delete from UNIX after N days




or try this:

let $cmdline = 'find /work8/outdir/names -type f -ctime +5 -exec rm ' ||
chr(123) || chr(125) || ' \;'

Tom

> -----Original Message-----
> From: Kristin Cagan [SMTP:kcagan@pobox.com]
> Sent: Tuesday, July 22, 2003 7:40 PM
> To:   sqr-users@sqrug.org
> Subject:      [sqr-users] Delete from UNIX after N days
> 
> Hi,
> 
> I've got a script that runs nightly and adds a new file to the output
> directory each time it runs.  I've been asked to have the SQR delete
> existing files that are more than 5 days old.
> 
> If I were doing this in UNIX directly, I would write:
> 
>   find /work8/outdir/names -type f -ctime +5 -exec rm {} \;
> 
> I tried the following in SQR:
> 
>   let $DelCommand = 'find work8/outdir/names -type f -ctime +5 -exec rm {}
> \;'
>   call SYSTEM using $DelCommand #status
> 
> SQR thinks that {} is a substitution variable and errors out.
> Can anyone recommend an alternative method?
> 
> Thanks,
> KC
> -- 
> Kristin Cagan
> Champion Strategeis, Inc.
> kcagan@pobox.com
> 
> 

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users