View previous topic :: View next topic |
Author |
Message |
joshdr77 Apprentice
Joined: 03 Jan 2003 Posts: 180
|
Posted: Sat Dec 18, 2004 2:16 am Post subject: screen, torrents and crontab |
|
|
hey people
i need alittle help
my isp has introducted unmetered downloads between 2:00am and 8:00am - i want to abuse this with all my mite.
i want to start btlaunchmanycurses.py within a screen session at 2:00am and end this at 8:00
any ideas howto do this?
thanks heaps - josh. |
|
Back to top |
|
|
maskedbishounen n00b
Joined: 19 May 2004 Posts: 29 Location: Atlanta, GA (USA)
|
Posted: Sat Dec 18, 2004 2:40 am Post subject: |
|
|
Shouldn't be too hard. :)
First, we want to ensure you start after the meter kicks out. So for safety's sake, we'll set a two minute offset, at two in the morning. We'll screen the process with a useful name (bt), and start it as your user.
Code: | 2 2 * * * user screen -Sdm bt btlaunchmanycurses.py /home/user/torrents |
Next, we want to kill it off, in case we forget about it the next morning. If you need smarter process killing, I'm sure you could filter it with some ps'ing and grep'ing. This is also timed a bit before the meter comes back into play, to avoid any time-offset issues.
Code: | 58 7 * * * user killall btlaunchmanycurses.py |
Assuming I haven't made any mistakes there, you can throw those into your /etc/crontab and it will (hopefully) work. Good luck! |
|
Back to top |
|
|
Beetle B. Guru
Joined: 01 Mar 2003 Posts: 524
|
Posted: Sat Dec 18, 2004 2:49 am Post subject: |
|
|
cron? _________________ Beetle B.
Please update the table of equivalents.
A Firefox guide. |
|
Back to top |
|
|
ChojinDSL l33t
Joined: 07 Jul 2003 Posts: 784
|
Posted: Sat Dec 18, 2004 2:49 am Post subject: |
|
|
Well, Im sure it would be possible to write a really fancy schmancy bash script that will continously check the time and activate/deactivate accordingly, but here's a theoretical crude method.
First of all stick all of your torrents you wish to download into a single directory.
Then you could either put an entry in crontab which starts "btlaunchmanycurses /path/to/my/torrents/" at a specific time. And another crontab entry which does "killall btlaunchmanycurses.py" at a specific time.
If you wanted to be able to periodically check the status via a screen session, then you could write a script that goes something like this:
cd /path/to/my/torrents
screen -S bittorrent
btlaunchmanycurses /path/to/my/torrents/
Then just remember to chmod+x that script file and configure crontab to start it at a specific time.
To kill it just add a killall entry in crontab like mentioned before.
If during the torrent session you wanna check the progress, you just do a
screen -r bittorrent
and voila'
I'm sure that you will find all the necessary details in the man pages. If not post again and I'll help out if Im not too lazy.
If you are on dialup and use a CLI tool to connect via modem, then the same principal applies.
Good luck! |
|
Back to top |
|
|
joshdr77 Apprentice
Joined: 03 Jan 2003 Posts: 180
|
Posted: Sat Dec 18, 2004 6:43 am Post subject: |
|
|
hey - thats how i envisioned doing it, and i even did as mentioned above before posting - but for some strange reason it just dies after like one minute after starting - im not sure why - ive been at the beach all day and will see if i can work out why soonish - if anyone has any ideas please let me know. |
|
Back to top |
|
|
joshdr77 Apprentice
Joined: 03 Jan 2003 Posts: 180
|
Posted: Sat Dec 18, 2004 6:55 am Post subject: |
|
|
hmmm - it only dies if i start the btlaunchmany within a screen - seems fine if i dont :S very weird |
|
Back to top |
|
|
joshdr77 Apprentice
Joined: 03 Jan 2003 Posts: 180
|
Posted: Sat Dec 18, 2004 7:42 am Post subject: |
|
|
ok - i tryed the headless version - with screen logging - no errors- it just quits
screen -L btlaunchmany.py --max_upload_rate 10 /mnt/stuff/torrent/tv/
goes for about 3secs then dies
if i do
screen [enter]
btlaunchmany.py --max_upload_rate 10 /mnt/stuff/torrent/tv/
its all good - only fails if i run the command........... |
|
Back to top |
|
|
joshdr77 Apprentice
Joined: 03 Jan 2003 Posts: 180
|
Posted: Sat Dec 18, 2004 10:33 am Post subject: |
|
|
man - i need to get this rocking soonish - im starting to feel tired and i want it to work!!! someone surely must be able to help me out :S
thanks in advance |
|
Back to top |
|
|
chunderbunny Veteran
Joined: 31 May 2004 Posts: 1281 Location: 51°24'27" N, 0°57'15" W
|
Posted: Sat Dec 18, 2004 1:15 pm Post subject: |
|
|
How many torrents are you putting in your torrents directory? I've noticed that btlaunchmany crashes if you try and get it to do too many torrents simultaneously on startup. It might be a better idea to have btlaunchmanycurses running permanently but use a script to copy the torrent files into the torrent directory at the appropriate time (and another to copy them out again.) |
|
Back to top |
|
|
joshdr77 Apprentice
Joined: 03 Jan 2003 Posts: 180
|
Posted: Sat Dec 18, 2004 1:19 pm Post subject: |
|
|
the same annoying behaviour even with a signle file in the directory - arghhhh - why dont things just work :S |
|
Back to top |
|
|
Gherald Veteran
Joined: 23 Aug 2004 Posts: 1399 Location: CLUAConsole
|
Posted: Sat Dec 18, 2004 1:44 pm Post subject: |
|
|
you might try nohup instead of screen |
|
Back to top |
|
|
maskedbishounen n00b
Joined: 19 May 2004 Posts: 29 Location: Atlanta, GA (USA)
|
Posted: Sat Dec 18, 2004 1:59 pm Post subject: |
|
|
Global options go after the directory. |
|
Back to top |
|
|
chunderbunny Veteran
Joined: 31 May 2004 Posts: 1281 Location: 51°24'27" N, 0°57'15" W
|
Posted: Sat Dec 18, 2004 2:32 pm Post subject: |
|
|
Aah! Of course, I should have seen that. Well spotted that man. |
|
Back to top |
|
|
joshdr77 Apprentice
Joined: 03 Jan 2003 Posts: 180
|
Posted: Sat Dec 18, 2004 5:01 pm Post subject: |
|
|
maskedbishounen wrote: | Global options go after the directory. |
i dont understand? global options |
|
Back to top |
|
|
Xaid Guru
Joined: 30 Oct 2004 Posts: 474 Location: Edmonton / Alberta
|
Posted: Sat Dec 18, 2004 5:10 pm Post subject: |
|
|
I think he means do:
screen -L btlaunchmany.py /mnt/stuff/torrent/tv/ --max_upload_rate 10 |
|
Back to top |
|
|
joshdr77 Apprentice
Joined: 03 Jan 2003 Posts: 180
|
Posted: Sat Dec 18, 2004 5:38 pm Post subject: |
|
|
sadly that did not fix the problem - it must be a screen bug? can someone test and see if they get the same syptoms as me
screen -Sdm bt btlaunchmanycurses /mnt/stuff/torrents/
thanks |
|
Back to top |
|
|
Xaid Guru
Joined: 30 Oct 2004 Posts: 474 Location: Edmonton / Alberta
|
Posted: Sat Dec 18, 2004 6:09 pm Post subject: |
|
|
screen -Sdm bt btlaunchmanycurses.py movies/torrents/
works like a charm here.
you typed:
screen -Sdm bt btlaunchmanycurses /mnt/stuff/torrents/
I think you are missing the .py? |
|
Back to top |
|
|
joshdr77 Apprentice
Joined: 03 Jan 2003 Posts: 180
|
Posted: Sat Dec 18, 2004 6:35 pm Post subject: |
|
|
this is so unfair - really it works like a charm - i have read other peoiple have had simular problems - your very lucky - i did forget to write teh ,py in the post - but not in my console :S
hmm - welll i have no idea - i guess im gonna have to set and alarm for 2:00am and 8:00 each day |
|
Back to top |
|
|
Fanatic Apprentice
Joined: 02 May 2004 Posts: 173 Location: Stocktown
|
Posted: Sat Dec 18, 2004 7:03 pm Post subject: |
|
|
joshdr77 wrote: | ok - i tryed the headless version - with screen logging - no errors- it just quits
screen -L btlaunchmany.py --max_upload_rate 10 /mnt/stuff/torrent/tv/
goes for about 3secs then dies
if i do
screen [enter]
btlaunchmany.py --max_upload_rate 10 /mnt/stuff/torrent/tv/
its all good - only fails if i run the command........... |
I have/had the same problem: https://forums.gentoo.org/viewtopic.php?t=264398&highlight=
The problem seems to be fixed with screen 4.0.2-r1, it doesn't exit after a couple seconds anymore. Not too sure though since I haven't been able to download any torrents today. |
|
Back to top |
|
|
joshdr77 Apprentice
Joined: 03 Jan 2003 Posts: 180
|
Posted: Sat Dec 18, 2004 8:36 pm Post subject: |
|
|
i hope it does - im emerge syncing on my server right now - thanks for your help |
|
Back to top |
|
|
joshdr77 Apprentice
Joined: 03 Jan 2003 Posts: 180
|
Posted: Sat Dec 18, 2004 8:41 pm Post subject: |
|
|
i uograded to the r1 of screen - still no good im using bittornado by the way |
|
Back to top |
|
|
maskedbishounen n00b
Joined: 19 May 2004 Posts: 29 Location: Atlanta, GA (USA)
|
Posted: Sat Dec 18, 2004 9:13 pm Post subject: |
|
|
I just tried it again to be sure, yet it's still working properly for me.
Code: | screen -Sdm bt btlaunchmanycurses.py ~/ --max_upload_rate 10 |
So I checked my screen version.
Code: | Calculating dependencies ...done!
[ebuild R ] app-misc/screen-4.0.2 |
The only one thing that's standing out so far is that you use BitTornado, rather than the mainline client. If Xaid and Fanatic could mention what versions they're using, it may be helpful.
Here's mine:
Code: | Calculating dependencies ...done!
[ebuild R ] net-p2p/bittorrent-3.4.2-r2 -X 0 kB |
If nothing else, you may want to try again with mainline. Who knows. |
|
Back to top |
|
|
joshdr77 Apprentice
Joined: 03 Jan 2003 Posts: 180
|
Posted: Sun Dec 19, 2004 3:07 am Post subject: |
|
|
hey - im changing over to main stream bittorrent now - ill let you guys know if i have greater succes later on tonite - cheers for your help |
|
Back to top |
|
|
joshdr77 Apprentice
Joined: 03 Jan 2003 Posts: 180
|
Posted: Sun Dec 19, 2004 3:14 am Post subject: |
|
|
just tried it with the main stream bittorrent client - it suffers from the same friggen annoying behaviour - its fine checking file integerty and as soon as thats done the screen terminates. |
|
Back to top |
|
|
joshdr77 Apprentice
Joined: 03 Jan 2003 Posts: 180
|
Posted: Sun Dec 19, 2004 12:42 pm Post subject: |
|
|
this is so frustrating - i have work tomorrow and i cant solve my problem - im so tired and i just want to download stufff - man help me someone plz |
|
Back to top |
|
|
|