question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What is the best method to keep scrapyrt open/active even after reboot

See original GitHub issue

I have been exploring many options on how to keep scrapyrt open and active even after reboot, but I am unsure what is best. I was thinking of using immortal.run. I have used tmux, but it eventually kills the scrapyrt process after sometime. Not sure how long it persists. I have also tried without success to write a bash script to start scrapyrt within a tmux session (new or existing) if the scrapyrt process is not active. Is immortal.run a good option? Is a simple bash script and using crontab (for example: @reboot) possible? I am open to any option that will work. Please share an example. Thanks. (I am currently using Ubuntu 18.04 VM on Azure)

Here is an example of my attempt at writing a script in bash:

#!/bin/bash
if ! pgrep -x "scrapyrt" > /dev/null
then
	SESSION_NAME=coinSpider
	tmux has-session -t $SESSION_NAME 2>/dev/null
	if [ $? -ne 0 ]
	then
		tmux new-session -d -s $SESSION_NAME "$*"
	fi
	tmux attach -t $SESSION_NAME \; \
	send-keys -t 'scrapyrt -p 9080 -i 0.0.0.0' C-m \;
fi

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kennylajaracommented, Apr 3, 2021

There is wiki here that could contain useful info like this, otherwise it could go to readthedocs docs https://github.com/scrapinghub/scrapyrt/wiki/Deploy

That documentation has the deployment to ubuntu server marked as todo since 2016.

0reactions
jagdish1o1commented, Nov 12, 2022

It’s 2022 and it’s still marked as todo since 2016

Read more comments on GitHub >

github_iconTop Results From Across the Web

scrapinghub - Bountysource
I have been exploring many options on how to keep scrapyrt open and active even after reboot, but I am unsure what is...
Read more >
Installation — scrapyrt 0.12 documentation
Spider.start_requests method. start_requests are executed by default when you run Scrapy Spider normally without ScrapyRT, but this method is NOT executed ...
Read more >
How to get scrapyrt's POST meta data? - python - Stack Overflow
There is an unmerged PR in scrapyRT that adds support to pass extra parameters inthe POST request. 1) Patch resources.py file located in ......
Read more >
scrapyrt - bytemeta
scrapyrt repo issues. ... Requesting max_items in scrapyrt. robinicole ... What is the best method to keep scrapyrt open/active even after reboot.
Read more >
Scrapinghub scrapyrt Issues - Giters
Scrapinghub scrapyrt: HTTP API for Scrapy spiders. ... What is the best method to keep scrapyrt open/active even after reboot. Updated 2 years...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found