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:
parent
71161c9b43
commit
a01f61f432
@ -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
|
||||
|
14
sd/test/scripts/cleanup.sh
Normal file
14
sd/test/scripts/cleanup.sh
Normal 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!"
|
Loading…
x
Reference in New Issue
Block a user