I got a python script in crontab
writing in a file 24/7 because is always getting information and writing on file FILE.txt.
I run another script on crontab
to get that content and send to a database (just what I want) and then truncate file.
But what happen? Lets suppose the file have 1000 bytes and I clear with that second script, the file after writing on it will have 1000 bytes + new bytes.
That 1000 bytes are strange symbols on file something like (?)(?)(?)(?)(?)
I tried the following:
file.seek(0)
file.truncate(0)
But without success.