0

I am trying to save the output of pip freeze of some of my python virtual enviroments each time my machine starts. So I initially have built the following bash script:

#!/bin/bash
/home/myuser/pathtovenv/bin/pip freeze > /somepath/requirements_`date '+%Y%m%d_%H%M%S'`.txt

It works fine when I execute it in the terminal.

So I added to the crontab:

@reboot cd /path_where_sh_is; ./freeze_venv.sh

and a few other variations:

@reboot /path_where_sh_is/freeze_venv.sh

without success. Why is that? How should I write the crontab line to make it work?

Alfonso_MA
  • 537
  • 5
  • 26

0 Answers0