Hello guys,
I have a script for Putty who sending everyday some report from a Win directory to Linux server with scp
Not sure if I can manage directly with this script, I would like to set some permissions on files before I sent,
The Linux directory have some restrictions, directory 775 (drwxrwxr-x) but file became from Win server with (640 -rw-r-----)
This is script:
$file = Get-ChildItem -Path C:\temp\smart_backup\*.csv |
Sort-Object -Property LastWriteTime -Descending |
select -First 1 -ExpandProperty FullName
$sProc = @{
FilePath = 'C:\Program Files (x86)\PuTTY\pscp.exe'
ArgumentList = "-scp -pw ******* $file smart@1.1.1.1:/data/smart/invoicing/"
}
Start-Process @sProc
Any suggestion or I should find a way in Linux server directly?
Thanks