This content has been marked as final. Show 5 replies
will answer your question.
Do you realize that when you run "scp" you are opening a new shell on the target? So setting "umask" will have no affect.
Try to copy with scp -p.
I tried scp -p and the file would keep the permissions from the original server. The issue is that the server permissions where -rw------- and I needed the permissions on the server that they where being moved to to be -rwxr----- so the -p would not work.
So I jut made a cron job to reset the permissions
2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38 * * * * chmod -R 750 /loglogic/ > /dev/null 2>&1
40,42,44,46,48,50,52,54,56,58 * * * * chmod -R 750 /loglogic/ > /dev/null 2>&1
Best practice, do not run command in cron, create script and run it in cron.