Send Motion-user mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/motion-user
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Motion-user digest..."


Today's Topics:

   1. Re: (no subject) (Barry Martin)


----------------------------------------------------------------------

Message: 1
Date: Thu, 6 Apr 2023 07:54:16 -0500
From: Barry Martin <[email protected]>
To: [email protected]
Subject: Re: [Motion-user] (no subject)
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"; Format="flowed"


Hi Denis!


>   How to configure delete files older than 10 days? or delete older video if 
> disk full or not space left?
>   How do I set the archive size and its age? I need to keep an archive for 30 
> days or the size is no more than 2000GB.
>   How to configure folders to be created in calendar format?

I use this script to automatically delete Motion files older than 35 
days -- alter the number for your requested 10 days:


In cron:


# Remove Motion video files older that 35 days from the NAS

35 0 * * * /bin/sh /home/pi/Scripts/FileDelete.sh

(The '35' here means 35 minutes past midnight -- time selected so as not 
to interfere with other jobs going on.)



cat Scripts/FileDelete.sh

#!/bin/sh


# Delete older backup files from NAS:

# Motion: /Drive_E/Motion/221


# Create date variables

DATE35=$(date +"%m-%d" --date="35 day ago")


# Delete files older than 35 days

echo "Moving to the NAS...."

sudo rm -rf /mnt/NAS_Motion/$DATE35



Probably not elegant but gets the job done.? I tend to heavily comment 
my files to remind me of what I did later, plus I am not trained.? The 
mounts connect to specific subdirectories on the NAS: the '221' up there 
is where the data from the Motion Raspberry Pi using the IP ending in 
.221 stores its data.


Calendar format is in motion.conf:

movie_filename %m-%d/%v-%Y%m%d%H%M%S

This will create the directory 04-06? (April 6th - U.S. format) and then 
within the directory file number (%v), year, month, etc.


Barry
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------



------------------------------

Subject: Digest Footer

_______________________________________________
Motion-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/motion-user


------------------------------

End of Motion-user Digest, Vol 200, Issue 2
*******************************************

Reply via email to