I have a script on a unix box which generate a log and send to a windows server.

My script has to run 4 times a day and it will append the result of each run on the same log, it means that the log on the windows server should be overwritten every time. After the first run it doesn't work and I get a

Permission denied

Which I guess that is because the file exists already on the windows server, all the rest of the script works fine and I have all the history in my log on the unix side.

The syntax of my script for the FTP is:

ftp -n $HOST << EOF
lcd /dba/logs/
mput monitor_FM2.log
exit 0

I tried also with put instead of mput, but the result is the same.

closed as off-topic by Jeff Schaller, sebasth, G-Man, Stephen Rauch, roaima Nov 26 '17 at 21:45

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Jeff Schaller, sebasth, G-Man, Stephen Rauch, roaima
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Does the owner on the file match the ftp user name? – Raman Sailopal Nov 23 '17 at 14:15
  • @RamanSailopal sorry, i found out what the issue was. Below what i did. Thanks anyway for your interest – FaMontyN2 Nov 23 '17 at 14:23
  • "I" is always uppercase on English. – peterh Nov 26 '17 at 21:05

I found out the problem. Basically the user I use to connect from unix to windows didn't have the right permissions on the windows folder, that's why my error. I gave it the permission it needs and now works fine.

Not the answer you're looking for? Browse other questions tagged or ask your own question.