cleaning /tmp and other directories...

I located the sysconfig settings to clear out old files in the /tmp
directory but from the the little documentation I have found I cannot
figure out how to list more than one directory. I need to clean /tmp
/data0/tmp /data1/tmp and /data2/tmp. What character can I use as a
separator?

Ted

Ted Miglautsch wrote:

> I located the sysconfig settings to clear out old files in the /tmp
> directory but from the the little documentation I have found I cannot
> figure out how to list more than one directory. I need to clean /tmp
> /data0/tmp /data1/tmp and /data2/tmp. What character can I use as a
> separator?
>
> Ted

I used yast - system - /etc/sysconfig Editor - cron to set up the
Directories I need cleaning at Boot Time.

Linux user 359911
openSUSE 11.1 (i586)
Linux 2.6.27.7-9-default i686 - Dell Inspiron 9300
4.1.87 (KDE 4.1.87 (KDE 4.2 >= 20090101)) “release 3.1”

Did you try space as a separator? The code in question is in /etc/init.d/boot.cleanup, and from the looks of it, space should work in the for loop. But if your directory paths have a space, that could be a problem.

        # delete temp files
        # If $CLEAR_TMP_DIRS_AT_BOOTUP = yes, delete files in
        # $TMP_DIRS_TO_CLEAR, if $CLEAR_TMP_DIRS_AT_BOOTUP starts with a "/"
        # delete files in those dirs instead.
        CLEAR_DIRS="$TMP_DIRS_TO_CLEAR"
        if  "${CLEAR_TMP_DIRS_AT_BOOTUP:0:1}" = "/" ]; then
          CLEAR_DIRS="$CLEAR_TMP_DIRS_AT_BOOTUP"
          CLEAR_TMP_DIRS_AT_BOOTUP=yes
        fi
        if test -x /usr/bin/find; then
            if test "$CLEAR_TMP_DIRS_AT_BOOTUP" = yes; then
                echo -n "Cleaning temporary directories $CLEAR_DIRS"
                for CURDIR in $CLEAR_DIRS ; do
                    find $CURDIR -maxdepth 1 -exec rm -rf {} +
                done
                rc_status -v -r
            fi
        fi

You can use backslash as an escape character to ignore spaces, as in


mv ./never\ put\ spaces\ in\ filenames ./thats.better

Otherwise, in bash at least, you can put it in quotes


mv "./never put spaces in filenames" ./thats.better

So in answer to the original question, maybe if it won’t work try enclosing each filename in quotes? (with a warning that that’s a total guess from a newbie :))