in reply to Re: unlink files
in thread unlink files

Any demo, so i can try

Replies are listed 'Best First'.
Re^3: unlink files
by karlgoethebier (Abbot) on Aug 07, 2024 at 17:07 UTC
    karl@rantanplan:~/src/myC$ touch nose karl@rantanplan:~/src/myC$ find . -type f -mmin 1 ./nose karl@rantanplan:~/src/myC$ find . -type f -mmin 3 -exec rm -i {} \; rm: remove regular empty file './nose'?

    Update: Add -size 0 for testing.

      My point is where do i need to correct

      where is the problem comes from

      How i can delete those files which are 30minutes older

      based on my script, not bash, or command line. your example are really confusing

      for my $file(@$folder) { my $time = (stat($file))[9]; my $mod_time = strftime('%M', localtime($time)); if ($mod_time > '30') { unlink glob "$folder/*.sql"; } }

        What do you think this line does:

        my $mod_time = strftime('%M', localtime($time));

        Compare this with the documentation of POSIX::strftime and localtime. Tell us where the documentation supports your interpretation.