Problem with filter cutoff: in Script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • danielas
    New User
    • Apr 2006
    • 1

    Problem with filter cutoff: in Script

    Dear all,

    I am using BC2 v2.4.1 to delete some old backup files with the following script:

    #
    criteria attrib:sh version timestamp:2sec binary
    option confirm:yes-to-all
    #
    load "D:\Backups\" "D:\Backups\"
    filter cutoff:<14days
    expand all
    select all
    delete all
    #
    However, this just deletes all the files in the directory.
    A search on the forum revealed a similar problem:

    filter question

    but my script seems to be correct.
    Does anyone have any ideas as to why my script isn't working? I would greatly appreciate any help you could offer.

    Thanks in advance,
    Dan
  • Chris
    Team Scooter
    • Oct 2007
    • 5538

    #2
    Re: Problem with filter cutoff: in Script

    Try changing your filter.

    Change it to filter cutoff:>14days

    This should only delete files older than 14 days.

    It may also help limit your selection to only files.

    criteria timestamp
    option confirm:yes-to-all
    load "D:\Backups\"
    filter cutoff:>14days
    expand all
    select all.files
    delete all
    Chris K Scooter Software

    Comment

    • Guest's Avatar

      #3
      Re: Problem with filter cutoff: in Script

      Chris --

      pardon me for jumping in on this, but your answer confused me.

      a) you used ">" in one suggestion and "<" in the other.

      b) the helpfile uses ">" as "newer" -- but if I'm reading the entry correctly (not given ;-} ) this means "newer files are excluded" -- which makes your first suggestion correct, I think...maybe?

      /dps

      Comment

      • Chris
        Team Scooter
        • Oct 2007
        • 5538

        #4
        Re: Problem with filter cutoff: in Script

        Sorry for the mistake. I corrected my previous post.

        It should be cutoff:>14days.

        This will delete any files that are 14 days or more old.
        Chris K Scooter Software

        Comment

        Working...