Not logged in. · Lost password · Register
Forum: General Help and Support Installation and Configuration RSS
[solved] cleanup.sh throws "too many arguments"
hkolbe #1
Member since Sep 2011 · 24 posts
Group memberships: Members
Show profile · Link to this post
Subject: [solved] cleanup.sh throws "too many arguments"
I'm using the current cleanup.sh - it throws thrice

line 19: [: too many arguments

I use it four times
cleanup ./path1/data 180
cleanup ./path2/data 180
cleanup ./path3/data 180
cleanup ./path4/data 180

but is throws only three errors...


this is line 19:
18:   # remove files older than ${retention_days} days from the cache
19:    if [ -e "${data_path}"/cache/?/ ]
This post was edited on 2018-09-13, 16:52 by hkolbe.
Avatar
schplurtz (Moderator) #2
Member since Nov 2009 · 265 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
I'm not a big fan of scripts that remove history... Anyway, here's a possible fix.
Replace line 18-22 with this :

    # remove files older than ${retention_days} days from the cache
    for dir in "${data_path}"/cache/?/. ; do
      if [ -e "$dir" ]
      then
        find "${data_path}"/cache/?/ -type f -mtime +${retention_days} -delete
        break
      fi
    done


but is throws only three errors...
Either there is an error in one the paths or the wiki has never been accessed at all.
http://schplurtz.free.fr/wiki/
This post was edited on 2018-06-07, 21:18 by schplurtz.
hkolbe #3
Member since Sep 2011 · 24 posts
Group memberships: Members
Show profile · Link to this post
Thank you very much - works like a charme!
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2018-09-23, 15:10:21 (UTC +02:00)