Crontab – Run in directory

All jobs are executed by a shell, so start that shell snippet by a command to change the directory. cd /path/to/directory && ./bin/myapp Concerning the use of && instead of ;: normally it doesn’t make a difference, but if the cd command fails (e.g. because the directory doesn’t exist) with && the application isn’t executed, … Read more

Relative paths in Python [duplicate]

In the file that has the script, you want to do something like this: import os dirname = os.path.dirname(__file__) filename = os.path.join(dirname, ‘relative/path/to/file/you/want’) This will give you the absolute path to the file you’re looking for. Note that if you’re using setuptools, you should probably use its package resources API instead. UPDATE: I’m responding to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)