Cannot run python script with cron

Clash Royale CLAN TAG#URR8PPP up vote
0
down vote
favorite
I have been trying to run python script using cron in regular interval and cron is not just working.
here is the result of crontab -e
6 9 * * * /etc/webmin/package-updates/update.pl
* * * * * echo "hellon" >> /home/username/test
* * * * * /usr/bin/python3 /home/username/Bot_files/remove_done.py
second line with "hellon" works fine but the last line doesn't work.
If I run it manually in terminal like
/usr/bin/python3 /home/username/Bot_files/remove_done.py
it works! that's totally driving me nut!
here is my server info
Linux server-name 4.4.0-124-generic #148-Ubuntu SMP Wed May 2 13:00:18 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
I have also tried putting it inside shell script file like
* * * * bash /home/username/Bot_files/remove_done.sh
And it still doesn't work
If anyone knows solution, please help me!
python cron
add a comment |Â
up vote
0
down vote
favorite
I have been trying to run python script using cron in regular interval and cron is not just working.
here is the result of crontab -e
6 9 * * * /etc/webmin/package-updates/update.pl
* * * * * echo "hellon" >> /home/username/test
* * * * * /usr/bin/python3 /home/username/Bot_files/remove_done.py
second line with "hellon" works fine but the last line doesn't work.
If I run it manually in terminal like
/usr/bin/python3 /home/username/Bot_files/remove_done.py
it works! that's totally driving me nut!
here is my server info
Linux server-name 4.4.0-124-generic #148-Ubuntu SMP Wed May 2 13:00:18 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
I have also tried putting it inside shell script file like
* * * * bash /home/username/Bot_files/remove_done.sh
And it still doesn't work
If anyone knows solution, please help me!
python cron
Two questions. How do you say line #3 doesn't work? Would you pelase redirect all outpur for line #3 with something like> /tmp/somelog 2>&1? You'd get both stdout and stderr output to that file.
â Uqbar
May 14 at 17:43
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have been trying to run python script using cron in regular interval and cron is not just working.
here is the result of crontab -e
6 9 * * * /etc/webmin/package-updates/update.pl
* * * * * echo "hellon" >> /home/username/test
* * * * * /usr/bin/python3 /home/username/Bot_files/remove_done.py
second line with "hellon" works fine but the last line doesn't work.
If I run it manually in terminal like
/usr/bin/python3 /home/username/Bot_files/remove_done.py
it works! that's totally driving me nut!
here is my server info
Linux server-name 4.4.0-124-generic #148-Ubuntu SMP Wed May 2 13:00:18 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
I have also tried putting it inside shell script file like
* * * * bash /home/username/Bot_files/remove_done.sh
And it still doesn't work
If anyone knows solution, please help me!
python cron
I have been trying to run python script using cron in regular interval and cron is not just working.
here is the result of crontab -e
6 9 * * * /etc/webmin/package-updates/update.pl
* * * * * echo "hellon" >> /home/username/test
* * * * * /usr/bin/python3 /home/username/Bot_files/remove_done.py
second line with "hellon" works fine but the last line doesn't work.
If I run it manually in terminal like
/usr/bin/python3 /home/username/Bot_files/remove_done.py
it works! that's totally driving me nut!
here is my server info
Linux server-name 4.4.0-124-generic #148-Ubuntu SMP Wed May 2 13:00:18 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
I have also tried putting it inside shell script file like
* * * * bash /home/username/Bot_files/remove_done.sh
And it still doesn't work
If anyone knows solution, please help me!
python cron
asked May 14 at 16:39
zmt27
1
1
Two questions. How do you say line #3 doesn't work? Would you pelase redirect all outpur for line #3 with something like> /tmp/somelog 2>&1? You'd get both stdout and stderr output to that file.
â Uqbar
May 14 at 17:43
add a comment |Â
Two questions. How do you say line #3 doesn't work? Would you pelase redirect all outpur for line #3 with something like> /tmp/somelog 2>&1? You'd get both stdout and stderr output to that file.
â Uqbar
May 14 at 17:43
Two questions. How do you say line #3 doesn't work? Would you pelase redirect all outpur for line #3 with something like
> /tmp/somelog 2>&1? You'd get both stdout and stderr output to that file.â Uqbar
May 14 at 17:43
Two questions. How do you say line #3 doesn't work? Would you pelase redirect all outpur for line #3 with something like
> /tmp/somelog 2>&1? You'd get both stdout and stderr output to that file.â Uqbar
May 14 at 17:43
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1036182%2fcannot-run-python-script-with-cron%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Two questions. How do you say line #3 doesn't work? Would you pelase redirect all outpur for line #3 with something like
> /tmp/somelog 2>&1? You'd get both stdout and stderr output to that file.â Uqbar
May 14 at 17:43