PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : [bash] inhalte eines dir ausführen



.:DENNIS:.
27-07-2006, 11:31
hallo,

folgendes Problem:
Beim Reboot des Systems, stoppen alle Downloads vom Torrentflux! Ich möchte nun ein Script, dass bei Systemstart ein Directory überprüft und dann sich alle darin enthaltenen *.torrent dateien merkt und ein "btphpdonwload.py /pfad/*.torrent" ausführt! Wie müsste so ein Script aussehen? Mit der Bash zu realisieren? Wenns leicht ist könnte es jemand programmieren??

grüße
dennis
...der neu hier ist...

roli
27-07-2006, 12:01
Im entsprechenden Directory ein:



for file in *.torrent
do
btphpdonwload.py ./$file
done


könnte ein Ansatz sein...

.:DENNIS:.
27-07-2006, 13:25
ok! danke erstma für die antwort!



# ./start.sh
Traceback (most recent call last):
File "/srv/www/htdocs/btorrent/TF_BitTornado/btphptornado.py", line 40, in ?
if __debug__: LOGFILE=open(argv[3]+"."+str(getpid()),"w")
IndexError: list index out of range


grüße
dennis

.:DENNIS:.
27-07-2006, 16:13
ok ich weis jetzt worans liegt!
der aufruhr des scriptes btphpdownload.py erfordert einige mehr angaben!
Dazu gehört auch zum *.torrent file das dazugehörige *.stat file!!
wie kann ich jetzt zB beide zugehörige files beispiels in die variablen $file1 und $file2 schreiben und dann folgendes ausführen:

btphptornado.py ./$file2 ./$file1

grüße
dennis

undefined
27-07-2006, 17:35
Nicht getestet ;)


#!/bin/bash

for i in *.torrent; do
STAT=$(echo $i | sed 's,torrent$,stat,')
if [ -n ""$STAT ] ; then
python btphpdonwload.py $i $STAT
fi
done

.:DENNIS:.
27-07-2006, 18:06
hallo,

thx für deine antwort!

Fehlermeldung:

Traceback (most recent call last):
File "/srv/www/htdocs/btorrent/TF_BitTornado/btphptornado.py", line 451, in ?
run(argv[1],argv[2],argv[3],argv[4],argv[5:])
File "/srv/www/htdocs/btorrent/TF_BitTornado/btphptornado.py", line 402, in run
if not dow.initFiles(old_style = True):
File "/srv/www/htdocs/btorrent/TF_BitTornado/BitTornado/download_bt1.py", line 542, in initFiles
return self.storagewrapper.old_style_init()
File "/srv/www/htdocs/btorrent/TF_BitTornado/BitTornado/BT1/StorageWrapper.py", line 159, in old_style_init
self.statusfunc(fractionDone = 0)
File "/srv/www/htdocs/btorrent/TF_BitTornado/btphptornado.py", line 169, in display
self.writeStatus()
File "/srv/www/htdocs/btorrent/TF_BitTornado/btphptornado.py", line 278, in writeStatus
raise KeyboardInterrupt
KeyboardInterrupt
Traceback (most recent call last):
File "/srv/www/htdocs/btorrent/TF_BitTornado/btphptornado.py", line 451, in ?
run(argv[1],argv[2],argv[3],argv[4],argv[5:])
File "/srv/www/htdocs/btorrent/TF_BitTornado/btphptornado.py", line 402, in run
if not dow.initFiles(old_style = True):
File "/srv/www/htdocs/btorrent/TF_BitTornado/BitTornado/download_bt1.py", line 542, in initFiles
return self.storagewrapper.old_style_init()
File "/srv/www/htdocs/btorrent/TF_BitTornado/BitTornado/BT1/StorageWrapper.py", line 159, in old_style_init
self.statusfunc(fractionDone = 0)
File "/srv/www/htdocs/btorrent/TF_BitTornado/btphptornado.py", line 169, in display
self.writeStatus()
File "/srv/www/htdocs/btorrent/TF_BitTornado/btphptornado.py", line 278, in writeStatus
raise KeyboardInterrupt
KeyboardInterrupt
Traceback (most recent call last):
File "/srv/www/htdocs/btorrent/TF_BitTornado/btphptornado.py", line 451, in ?
run(argv[1],argv[2],argv[3],argv[4],argv[5:])
File "/srv/www/htdocs/btorrent/TF_BitTornado/btphptornado.py", line 402, in run
if not dow.initFiles(old_style = True):
File "/srv/www/htdocs/btorrent/TF_BitTornado/BitTornado/download_bt1.py", line 542, in initFiles
return self.storagewrapper.old_style_init()
File "/srv/www/htdocs/btorrent/TF_BitTornado/BitTornado/BT1/StorageWrapper.py", line 159, in old_style_init
self.statusfunc(fractionDone = 0)
File "/srv/www/htdocs/btorrent/TF_BitTornado/btphptornado.py", line 169, in display
self.writeStatus()
File "/srv/www/htdocs/btorrent/TF_BitTornado/btphptornado.py", line 278, in writeStatus
raise KeyboardInterrupt
KeyboardInterrupt


grüße
dennis

Romanday
27-07-2006, 21:08
Fehlermeldung:

grüße
dennis

Kann es sein das die Datei
btphpdownload.py heißt,
und nicht btphpdonwload.py ???

.:DENNIS:.
27-07-2006, 21:12
achjaa....heist auch nicht so...sondern btphptornado.py! ist aber in all meinen scripten richtig angepasst!

grüße
dennis