1
0
mirror of https://github.com/fritz-smh/yi-hack synced 2025-06-07 16:06:11 +00:00

PR #23 Create Script detele file or videos after few days

This commit is contained in:
fritz-smh 2016-06-08 22:00:49 +02:00
parent 71161c9b43
commit a01f61f432
2 changed files with 20 additions and 0 deletions

View File

@ -18,3 +18,9 @@ Source of the script :
* https://github.com/fritz-smh/yi-hack/pull/24
* http://4pda.ru/forum/index.php?showtopic=638230&st=2780#entry44208114
cleanup.sh
==========
This script will cleanup video files older than 15 days.
You need to add it in the crontab

View File

@ -0,0 +1,14 @@
#!/bin/sh
#Delete files and folders more than 15 days
dir="/home/hd1/record/"
days=+15
dt=`date +%y%m%d`
#echo $dir
#echo $days
#echo $dt
#Command:
du -sh ${dir} > ${dir}Delete_$dt.log
find ${dir} -mtime $days -exec rm -Rf {} \;
du -sh ${dir} >> ${dir}Delete_$dt.log
echo "Works!"