Add guide to setup cron task with new virtualenv

Issue #54 resolved
Former user created an issue

Hi,

Could you add some tips to the readme to help setup a Cron task with the new python3 virtual environment and autograbber.

Comments (4)

  1. Former user Account Deleted reporter

    Example of my bash script that doesn't work.

    mabo@debian:~$ cat auto-grab-env.sh 
    #/bin/sh
    
    source /home/mabo/webdl/.virtualenv/bin/activate
    
    sudo -u mabo /home/mabo/webdl/autograbber.py  /home/mabo/Videos /home/mabo/webdl/patterns.txt
    

    Error that I get when running the script.

    mabo@debian:~$ ./auto-grab-env.sh 
    Traceback (most recent call last):
      File "/home/mabo/webdl/autograbber.py", line 3, in <module>
        from common import load_root_node
      File "/home/mabo/webdl/common.py", line 9, in <module>
        import requests_cache
    ImportError: No module named 'requests_cache
    
  2. delx repo owner

    The reason your script doesn't work is that you are activating the virtualenv and then using sudo. Running sudo resets your environment variables, so this is the same as not activating the virtualenv at all.

    I've committed the script which I use to the git repo. Hopefully that'll help.

  3. Former user Account Deleted reporter
    • removed responsible

    The problem I am seeing is related to my unique setup because I use webdl via a VPN connection.

    This appears to work;

    mabo@debian:~$ cat auto-grab-env.sh 
    #/bin/sh
    
    source /home/mabo/webdl/.virtualenv/bin/activate
    
    /home/mabo/webdl/autograbber.py  /home/mabo/Videos /home/mabo/webdl/patterns.txt
    
  4. Log in to comment