pertinent parts of python script that creates/writes log files
def kill(fullpath,typ):
#add check to assure .recycle!!!!
if any(check for check in requiredChecks if check in fullpath) and typ=='file':
os.remove(fullpath)
logFile.write('file -- ' + fullpath + '\n')
return
curDate = datetime.datetime.now()
logName = '/home/user/backupLogs/recycleBin_'+curDate.strftime('%Y-%m-%d')+'.log '
logFile = ''
if not os.path.exists(logName):
logFile = open(logName,'w') #log file doesn't exist, create it and open in write mode
else:
logFile = open(logName, 'a') #log file exists, create it and open in append mode
logFile.write(curDate.isoformat() + '\n')
kill("/some/file/path.foo","file")
logFile.close()
this script is cron executed daily by root:root. Each day's .log file is a different size, so it is successfully writing.
But I cannot view the file!
administrator@server1: sudo su
root@server1: vi /home/user/backupLogs/recycleBin_2015-06-03.log
vim just opens a blank file and at the bottom says [new file] I double and triple checked that the file does exist.
what is going on here?