-3

I have some python scripts running on AWS-ec2 instance on crontab. Every day I found "~" directory in my home directory. Don't know why this happening.

I have to manually remove the ~ (tilde) directory from home-dir.

When I run these script on local ubuntu machine. It's working fine.

1 Answers1

3

There is a bug in the one of the scripts that you are running that is creating this.

Typical shells ~ is used to refer to the users home. And somewhere this is being used where is is not really replaced. Because these are python scripts you might need to manually handle those. See - How to get the home directory in Python?

Yogesh_D
  • 14,022
  • 8
  • 31
  • 47
  • Thanks for the answer. I found the script where I'm using '''~/.config''' as path. Also, I have some UD functions in /home/{user-name}/udf/udf.py with __init__ file in the dir. Might be this is creating an issue. how can I solve this? – Harpreet Singh Jun 14 '19 at 06:14
  • Have a look at where the above mentioned path is used. You would have to look at various things, places where files are created, places where command output is redirected. These are a good starting point, basically you would have to end up debugging the scripts to figure out where you the bug is. – Yogesh_D Jun 16 '19 at 17:15