Maintenance script

Maintenance script

What is the GMN? Forums Installation Maintenance script

This topic contains 5 replies, has 2 voices, and was last updated by  Carballada 9 months, 4 weeks ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #234

    Carballada
    Participant

    Hi, is there any script to delete all data folders after some time?
    I could create one but I could not find it on your github.
    With a 64GB and this time of the year (long nights) I think I could keep 4 days…
    Also, I copy RMS_data to my NAS but I prefer to keep it on the RMS in case of coms problems with the storage server.

    thank you

    #235

    Carballada
    Participant

    I will use this via cron

    #! /bin/bash

    # Automatically delete old images and videos, more than 3 days

    del=$(date –date=”3 days ago” +%Y%m%d)

    echo $del

    for i in find /home/pi/RMS_data/CapturedFiles/ -type d -name "ES0001_2*"; do
    #(($del > $(basename $i))) && rm -rf $i
    echo “list ” $i
    INPUT=$(basename $i)
    SUBSTRING=$(echo $INPUT| cut -d’_’ -f 2)
    if [[ $del > $SUBSTRING ]]; then
    echo “delete ” $i
    rm -rf $i
    fi
    done

    • This reply was modified 10 months ago by  Carballada.
    • This reply was modified 10 months ago by  Carballada.
    • This reply was modified 10 months ago by  Carballada.
    #240

    dvida
    Keymaster

    Hi Jose,
    the script already exists and it should be working. It is here: LINK
    You can see that this function is called in RMS.StartCapture. Is it not working for you?

    Old data might not get deleted if the station code was changed, then it won’t delete the folder with the old code, but as long as the code says the same it should be OK.

    #242

    Carballada
    Participant

    ok!! thank you, I will stop mine and I will use this of course

    #244

    dvida
    Keymaster

    Just to be clear – the script is already working automatically, so you don’t have to call it manually.
    So the folders from Captured and Archived directories get deleted, but the .tar.bz2 archives in ArchivedFiles are not deleted. Station operators have to back those up and delete manually. Mind you, these files get uploaded to the server as well, but it’s good to have a local copy.

    #246

    Carballada
    Participant

    Yes, I understood the same. My problem was that I saw how the space was decreasing and I prepare something before wait your response.
    I left everything like it comes 😀 only I cron a backup job to my NAS via rsync (I use CMN pointing to this NAS).

    Now only wait to less moon but the weather will be terrible next days here at Barcelona. I hope to take something from next Geminids, will see.

    thank you for you support 😀

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.