btdownload*.py, works from Command Line, not from cron
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Originally posted by niknah cron jobs send errors to your mail, check /var/spool/mail/???
for any messages.
First thing I checked. Root is not getting mail messages about this, I have no "root" under /var/spool/mail, but I run "mail" as root and all I see are some cron errors for a user's unrelated crontab. (Which I am used to. Its a permissions issue that I have not bothered to fix.)
Quote:
also try redirecting to /dev/null like...
python btdownload ..... </dev/null >/dev/null
I tried that, thinking that it was insisting on dumping output somewhere, but it did not help. I pulled that off (and retried) before posting here to avoid confusion.
should set you up with all the normal environment variables before running your script.
Same results. The two cp commands function normally, but the download does not.
Quote:
[i]
If the help message won't come up it sounds like python may not be starting up right, try it with...
python -v ....
and look for messages in your mail. [/B]
Adding the -v into the script has no visible effect when run from cron. Lots of messages (verbose) when I run from CL. I do see an addition to /var/mail, but it is in a mailbox for "postfix" rather than root.
Code:
From root@bigbox.loraxhaven.home.net Mon May 30 16:52:01 2005
Return-Path: <root@bigbox.loraxhaven.home.net>
X-Original-To: root
Delivered-To: postfix@bigbox.loraxhaven.home.net
Received: by bigbox.loraxhaven.home.net (Postfix, from userid 0)
id EC178EC1B1; Mon, 30 May 2005 16:52:00 -0400 (EDT)
From: root@bigbox.loraxhaven.home.net (Cron Daemon)
To: root@bigbox.loraxhaven.home.net
Subject: Cron <root@bigbox> /bin/bash --login -c /usr/scripts/FetchRachelMaddow
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
Message-Id: <20050530205200.EC178EC1B1@bigbox.loraxhaven.home.net>
Date: Mon, 30 May 2005 16:52:00 -0400 (EDT)
stdin: is not a tty
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /usr/lib/python2.3/site.pyc matches /usr/lib/python2.3/site.py
import site # precompiled from /usr/lib/python2.3/site.pyc
# /usr/lib/python2.3/os.pyc matches /usr/lib/python2.3/os.py
import os # precompiled from /usr/lib/python2.3/os.pyc
import posix # builtin
# /usr/lib/python2.3/posixpath.pyc matches /usr/lib/python2.3/posixpath.py
import posixpath # precompiled from /usr/lib/python2.3/posixpath.pyc
# /usr/lib/python2.3/stat.pyc matches /usr/lib/python2.3/stat.py
import stat # precompiled from /usr/lib/python2.3/stat.pyc
# /usr/lib/python2.3/UserDict.pyc matches /usr/lib/python2.3/UserDict.py
import UserDict # precompiled from /usr/lib/python2.3/UserDict.pyc
# /usr/lib/python2.3/copy_reg.pyc matches /usr/lib/python2.3/copy_reg.py
import copy_reg # precompiled from /usr/lib/python2.3/copy_reg.pyc
# /usr/lib/python2.3/types.pyc matches /usr/lib/python2.3/types.py
import types # precompiled from /usr/lib/python2.3/types.pyc
# /usr/lib/python2.3/warnings.pyc matches /usr/lib/python2.3/warnings.py
import warnings # precompiled from /usr/lib/python2.3/warnings.pyc
# /usr/lib/python2.3/linecache.pyc matches /usr/lib/python2.3/linecache.py
import linecache # precompiled from /usr/lib/python2.3/linecache.pyc
import encodings # directory /usr/lib/python2.3/encodings
# /usr/lib/python2.3/encodings/__init__.pyc matches /usr/lib/python2.3/encodings/__init__.py
import encodings # precompiled from /usr/lib/python2.3/encodings/__init__.pyc
# /usr/lib/python2.3/codecs.pyc matches /usr/lib/python2.3/codecs.py
import codecs # precompiled from /usr/lib/python2.3/codecs.pyc
import _codecs # builtin
# /usr/lib/python2.3/encodings/aliases.pyc matches /usr/lib/python2.3/encodings/aliases.py
import encodings.aliases # precompiled from /usr/lib/python2.3/encodings/aliases.pyc
# /usr/lib/python2.3/encodings/latin_1.pyc matches /usr/lib/python2.3/encodings/latin_1.py
import encodings.latin_1 # precompiled from /usr/lib/python2.3/encodings/latin_1.pyc
Python 2.3.4 (#2, Feb 9 2005, 14:22:48)
[GCC 3.4.1 (Mandrakelinux 10.1 3.4.1-4mdk)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import BitTorrent # directory /usr/lib/python2.3/site-packages/BitTorrent
# /usr/lib/python2.3/site-packages/BitTorrent/__init__.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/__init__.py
import BitTorrent # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/__init__.pyc
# /usr/lib/python2.3/site-packages/BitTorrent/download.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/download.py
import BitTorrent.download # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/download.pyc
# /usr/lib/python2.3/site-packages/BitTorrent/zurllib.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/zurllib.py
import BitTorrent.zurllib # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/zurllib.pyc
# /usr/lib/python2.3/urllib.pyc matches /usr/lib/python2.3/urllib.py
import urllib # precompiled from /usr/lib/python2.3/urllib.pyc
# /usr/lib/python2.3/string.pyc matches /usr/lib/python2.3/string.py
import string # precompiled from /usr/lib/python2.3/string.pyc
import strop # dynamically loaded from /usr/lib/python2.3/lib-dynload/strop.so
# /usr/lib/python2.3/socket.pyc matches /usr/lib/python2.3/socket.py
import socket # precompiled from /usr/lib/python2.3/socket.pyc
import _socket # dynamically loaded from /usr/lib/python2.3/lib-dynload/_socket.so
import _ssl # dynamically loaded from /usr/lib/python2.3/lib-dynload/_ssl.so
import errno # builtin
import time # dynamically loaded from /usr/lib/python2.3/lib-dynload/time.so
# /usr/lib/python2.3/urllib2.pyc matches /usr/lib/python2.3/urllib2.py
import urllib2 # precompiled from /usr/lib/python2.3/urllib2.pyc
# /usr/lib/python2.3/base64.pyc matches /usr/lib/python2.3/base64.py
import base64 # precompiled from /usr/lib/python2.3/base64.pyc
import binascii # dynamically loaded from /usr/lib/python2.3/lib-dynload/binascii.so
# /usr/lib/python2.3/ftplib.pyc matches /usr/lib/python2.3/ftplib.py
import ftplib # precompiled from /usr/lib/python2.3/ftplib.pyc
# /usr/lib/python2.3/gopherlib.pyc matches /usr/lib/python2.3/gopherlib.py
import gopherlib # precompiled from /usr/lib/python2.3/gopherlib.pyc
# /usr/lib/python2.3/httplib.pyc matches /usr/lib/python2.3/httplib.py
import httplib # precompiled from /usr/lib/python2.3/httplib.pyc
# /usr/lib/python2.3/mimetools.pyc matches /usr/lib/python2.3/mimetools.py
import mimetools # precompiled from /usr/lib/python2.3/mimetools.pyc
# /usr/lib/python2.3/rfc822.pyc matches /usr/lib/python2.3/rfc822.py
import rfc822 # precompiled from /usr/lib/python2.3/rfc822.pyc
# /usr/lib/python2.3/tempfile.pyc matches /usr/lib/python2.3/tempfile.py
import tempfile # precompiled from /usr/lib/python2.3/tempfile.pyc
# /usr/lib/python2.3/random.pyc matches /usr/lib/python2.3/random.py
import random # precompiled from /usr/lib/python2.3/random.pyc
import math # dynamically loaded from /usr/lib/python2.3/lib-dynload/math.so
import _random # dynamically loaded from /usr/lib/python2.3/lib-dynload/_random.so
import fcntl # dynamically loaded from /usr/lib/python2.3/lib-dynload/fcntl.so
import thread # builtin
# /usr/lib/python2.3/urlparse.pyc matches /usr/lib/python2.3/urlparse.py
import urlparse # precompiled from /usr/lib/python2.3/urlparse.pyc
import cStringIO # dynamically loaded from /usr/lib/python2.3/lib-dynload/cStringIO.so
# /usr/lib/python2.3/inspect.pyc matches /usr/lib/python2.3/inspect.py
import inspect # precompiled from /usr/lib/python2.3/inspect.pyc
# /usr/lib/python2.3/re.pyc matches /usr/lib/python2.3/re.py
import re # precompiled from /usr/lib/python2.3/re.pyc
# /usr/lib/python2.3/sre.pyc matches /usr/lib/python2.3/sre.py
import sre # precompiled from /usr/lib/python2.3/sre.pyc
# /usr/lib/python2.3/sre_compile.pyc matches /usr/lib/python2.3/sre_compile.py
import sre_compile # precompiled from /usr/lib/python2.3/sre_compile.pyc
import _sre # builtin
# /usr/lib/python2.3/sre_constants.pyc matches /usr/lib/python2.3/sre_constants.py
import sre_constants # precompiled from /usr/lib/python2.3/sre_constants.pyc
# /usr/lib/python2.3/sre_parse.pyc matches /usr/lib/python2.3/sre_parse.py
import sre_parse # precompiled from /usr/lib/python2.3/sre_parse.pyc
# /usr/lib/python2.3/dis.pyc matches /usr/lib/python2.3/dis.py
import dis # precompiled from /usr/lib/python2.3/dis.pyc
# /usr/lib/python2.3/opcode.pyc matches /usr/lib/python2.3/opcode.py
import opcode # precompiled from /usr/lib/python2.3/opcode.pyc
import imp # builtin
# /usr/lib/python2.3/tokenize.pyc matches /usr/lib/python2.3/tokenize.py
import tokenize # precompiled from /usr/lib/python2.3/tokenize.pyc
# /usr/lib/python2.3/token.pyc matches /usr/lib/python2.3/token.py
import token # precompiled from /usr/lib/python2.3/token.pyc
import md5 # dynamically loaded from /usr/lib/python2.3/lib-dynload/md5.so
# /usr/lib/python2.3/mimetypes.pyc matches /usr/lib/python2.3/mimetypes.py
import mimetypes # precompiled from /usr/lib/python2.3/mimetypes.pyc
import sha # dynamically loaded from /usr/lib/python2.3/lib-dynload/sha.so
# /usr/lib/python2.3/gzip.pyc matches /usr/lib/python2.3/gzip.py
import gzip # precompiled from /usr/lib/python2.3/gzip.pyc
import struct # dynamically loaded from /usr/lib/python2.3/lib-dynload/struct.so
import zlib # dynamically loaded from /usr/lib/python2.3/lib-dynload/zlib.so
# /usr/lib/python2.3/StringIO.pyc matches /usr/lib/python2.3/StringIO.py
import StringIO # precompiled from /usr/lib/python2.3/StringIO.pyc
# /usr/lib/python2.3/site-packages/BitTorrent/__init__.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/__init__.py
import BitTorrent.__init__ # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/__init__.pyc
# /usr/lib/python2.3/pprint.pyc matches /usr/lib/python2.3/pprint.py
import pprint # precompiled from /usr/lib/python2.3/pprint.pyc
# /usr/lib/python2.3/site-packages/BitTorrent/btformats.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/btformats.py
import BitTorrent.btformats # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/btformats.pyc
# /usr/lib/python2.3/site-packages/BitTorrent/Choker.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/Choker.py
import BitTorrent.Choker # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/Choker.pyc
# /usr/lib/python2.3/site-packages/BitTorrent/Storage.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/Storage.py
import BitTorrent.Storage # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/Storage.pyc
# /usr/lib/python2.3/bisect.pyc matches /usr/lib/python2.3/bisect.py
import bisect # precompiled from /usr/lib/python2.3/bisect.pyc
# /usr/lib/python2.3/site-packages/BitTorrent/fakeopen.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/fakeopen.py
import BitTorrent.fakeopen # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/fakeopen.pyc
# /usr/lib/python2.3/site-packages/BitTorrent/StorageWrapper.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/StorageWrapper.py
import BitTorrent.StorageWrapper # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/StorageWrapper.pyc
# /usr/lib/python2.3/threading.pyc matches /usr/lib/python2.3/threading.py
import threading # precompiled from /usr/lib/python2.3/threading.pyc
# /usr/lib/python2.3/traceback.pyc matches /usr/lib/python2.3/traceback.py
import traceback # precompiled from /usr/lib/python2.3/traceback.pyc
# /usr/lib/python2.3/atexit.pyc matches /usr/lib/python2.3/atexit.py
import atexit # precompiled from /usr/lib/python2.3/atexit.pyc
# /usr/lib/python2.3/site-packages/BitTorrent/bitfield.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/bitfield.py
import BitTorrent.bitfield # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/bitfield.pyc
# /usr/lib/python2.3/site-packages/BitTorrent/Uploader.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/Uploader.py
import BitTorrent.Uploader # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/Uploader.pyc
# /usr/lib/python2.3/site-packages/BitTorrent/CurrentRateMeasure.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/CurrentRateMeasure.py
import BitTorrent.CurrentRateMeasure # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/CurrentRateMeasure.pyc
# /usr/lib/python2.3/site-packages/BitTorrent/Downloader.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/Downloader.py
import BitTorrent.Downloader # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/Downloader.pyc
# /usr/lib/python2.3/site-packages/BitTorrent/Connecter.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/Connecter.py
import BitTorrent.Connecter # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/Connecter.pyc
# /usr/lib/python2.3/site-packages/BitTorrent/Encrypter.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/Encrypter.py
import BitTorrent.Encrypter # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/Encrypter.pyc
# /usr/lib/python2.3/site-packages/BitTorrent/RawServer.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/RawServer.py
import BitTorrent.RawServer # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/RawServer.pyc
import select # dynamically loaded from /usr/lib/python2.3/lib-dynload/select.so
# /usr/lib/python2.3/site-packages/BitTorrent/Rerequester.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/Rerequester.py
import BitTorrent.Rerequester # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/Rerequester.pyc
# /usr/lib/python2.3/site-packages/BitTorrent/bencode.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/bencode.py
import BitTorrent.bencode # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/bencode.pyc
# /usr/lib/python2.3/site-packages/BitTorrent/DownloaderFeedback.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/DownloaderFeedback.py
import BitTorrent.DownloaderFeedback # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/DownloaderFeedback.pyc
# /usr/lib/python2.3/site-packages/BitTorrent/RateMeasure.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/RateMeasure.py
import BitTorrent.RateMeasure # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/RateMeasure.pyc
# /usr/lib/python2.3/site-packages/BitTorrent/PiecePicker.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/PiecePicker.py
import BitTorrent.PiecePicker # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/PiecePicker.pyc
# /usr/lib/python2.3/site-packages/BitTorrent/parseargs.pyc matches /usr/lib/python2.3/site-packages/BitTorrent/parseargs.py
import BitTorrent.parseargs # precompiled from /usr/lib/python2.3/site-packages/BitTorrent/parseargs.pyc
import curses # directory /usr/lib/python2.3/curses
# /usr/lib/python2.3/curses/__init__.pyc matches /usr/lib/python2.3/curses/__init__.py
import curses # precompiled from /usr/lib/python2.3/curses/__init__.pyc
import _curses # dynamically loaded from /usr/lib/python2.3/lib-dynload/_curses.so
# /usr/lib/python2.3/curses/wrapper.pyc matches /usr/lib/python2.3/curses/wrapper.py
import curses.wrapper # precompiled from /usr/lib/python2.3/curses/wrapper.pyc
Error opening terminal: unknown.
dlopen("/usr/lib/python2.3/lib-dynload/strop.so", 2);
dlopen("/usr/lib/python2.3/lib-dynload/_socket.so", 2);
dlopen("/usr/lib/python2.3/lib-dynload/_ssl.so", 2);
dlopen("/usr/lib/python2.3/lib-dynload/time.so", 2);
dlopen("/usr/lib/python2.3/lib-dynload/binascii.so", 2);
dlopen("/usr/lib/python2.3/lib-dynload/math.so", 2);
dlopen("/usr/lib/python2.3/lib-dynload/_random.so", 2);
dlopen("/usr/lib/python2.3/lib-dynload/fcntl.so", 2);
dlopen("/usr/lib/python2.3/lib-dynload/cStringIO.so", 2);
dlopen("/usr/lib/python2.3/lib-dynload/md5.so", 2);
dlopen("/usr/lib/python2.3/lib-dynload/sha.so", 2);
dlopen("/usr/lib/python2.3/lib-dynload/struct.so", 2);
dlopen("/usr/lib/python2.3/lib-dynload/zlib.so", 2);
dlopen("/usr/lib/python2.3/lib-dynload/select.so", 2);
dlopen("/usr/lib/python2.3/lib-dynload/_curses.so", 2);
that's good, you don't need curses from cron.
Curses is just the fancy text pretend gui thing, I thought it would go away with >/dev/null </dev/null but I guess not.
Originally posted by niknah that's good, you don't need curses from cron.
Curses is just the fancy text pretend gui thing, I thought it would go away with >/dev/null </dev/null but I guess not.
Yeah, I knew that. I wish I had a more elegant solution. Because this will of course start failing should I ever upgrade my btdownload package.
Would you consider this a bug? (I would.) And therefore something that should be reported to the btdownload folks?
"Error opening terminal: unknown" when running btdownloadheadless from 'at'
Quote:
Originally Posted by SkipHuffman
Yeah, I knew that. I wish I had a more elegant solution. Because this will of course start failing should I ever upgrade my btdownload package.
Would you consider this a bug? (I would.) And therefore something that should be reported to the btdownload folks?
Thanks for your help on this.
Skip
I get the same error when running btdownloadheadless via 'at'. This has already been reported as a bug on the Debian BTS (#327505), and I have added my comment.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.