[add] change cron script file for exemple

This commit is contained in:
Knah Tsaeb 2013-07-26 13:45:25 +02:00
parent 277ca16643
commit 1456ee20a8
4 changed files with 49 additions and 3 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
data
tmp
videos
.project
.projectbin/cronTask.sh

13
.project Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>mytube.local</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
<nature>com.aptana.projects.webnature</nature>
<nature>com.aptana.editor.php.phpNature</nature>
</natures>
</projectDescription>

View File

@ -1,6 +1,6 @@
#!/bin/bash/
finalDest=/srv/http/mytube.local/videos/
tempDest=/srv/http/mytube.local/tmp/
finalDest=/srv/http/sovigall.local/videos/
tempDest=/srv/http/sovigall.local/tmp/
threads=3 # nb cpu core - 1
cd $tempDest

33
bin/cronTask.sh.sample Normal file
View File

@ -0,0 +1,33 @@
#!/bin/bash/
finalDest=/path/of/sovigall/videos/
tempDest=/path/of/sovigall/tmp/
threads=3 # nb cpu core - 1
cd $tempDest
nbProcessLauch=$(ps -e | grep -v grep | grep youtube-dl | wc -l)
if [ $nbProcessLauch != 0 ]
then
echo 'bye'
exit
fi
for file in $tempDest*.hash
do
if [[ -f $file ]];
then
while read urlHash url destination
do
youtube-dl -R 0 -c --write-thumbnail --write-info-json --recode-video webm --no-check-certificate -f 45/46/37/45/22/44/35/34/5 -o "$urlHash.%(ext)s" "$url"
sleep 5
if [ ! -f $urlHash.*.part ]
then
rm $file
sleep 1
mv $urlHash* $finalDest$destination
fi
done < $file
fi
done
# -rc_lookahead 16 -g 360 -threads 3