Jump to content

Run Program Feature - what?


whatiwonder

Recommended Posts

Hi there, I'm not super new to uT, and I'm by no means a noob when it comes to geeky-nerdy computer stuff, but this issue really has me stumped. And if this makes absolutely no sense, please tell me and I will elaborate. Sometimes I get caught up and just spout out the mess that's in my brain.

I'm currently running the uTorrent Alpha on Ubuntu (it's actually XBMCbuntu, but it's basically the same as Ubuntu Server 12.10). I currently have the "Run Program" feature set so it runs a #!/bin/bash script that I wrote for extracting and copying newly completed downloads. But I'm having some issues. The script runs fine by itself when run in a user-shell, but it contains a reference to finding the newest item in my downloads folder (specifically, the command is: "$(ls -t /home/user/Downloads/ | head -1)". But, uTorrent doesn't execute the script quickly enough, so if a new, previously queued torrent begins downloading, the script finds the incomplete folder and does nothing except create empty directories (because all the files in the just-started-downloading folder are incomplete). I also may have fixed the timing/delay issue by adding a directory to the "Put new downloads here:" line.

So I wrote in the "run command when torrent finishes" box, and it now says: /my/script "%N" >> torrentname.log , and I adjusted my script so instead of "$(ls -t /home/user/Downloads/ | head -1)" it now says "$(cat torrentname.log)" ... I got uTorrent to recognize that line, but it doesn't seem to recognize the ">>" and refuses to create the .log file. And it's also giving me errors like this: Usage: grep [OPTION]... PATTERN [FILE]...

as if I didn't write anything after grep in my script. also gives me similar errors with the "ls" command and also the "cat" command.

HELP!!!

What i Wonder :???:

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...