![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Windows & DOS: Issues & Discussions All Windows and DOS questions should go here as well. Discuss UNIX to Windows (Desktop or Server) here! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| pscp.exe trasforms a.sh to 'a.sh ' | zzol | Shell Programming and Scripting | 2 | 01-01-2009 11:28 PM |
| Delete line in file based on data in another file | earth_goddess | Shell Programming and Scripting | 1 | 12-29-2008 10:47 AM |
| how to delete record in file data with index in another file? | zhynxn | Shell Programming and Scripting | 0 | 07-06-2006 12:03 AM |
| i want to delete a file based on existing file in a directory | srivsn | Shell Programming and Scripting | 3 | 04-11-2006 04:38 AM |
| Get file from source server and delete the ftp file | lweegp | Shell Programming and Scripting | 3 | 10-17-2005 02:53 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Can we delete file using PSCP?
Hello,
I am using PSCP to do file transfer from remote server to window system. It works well. But the file is only copying, but in my case once after file copied, we should not have the same file on the remote server it should be moved to the windows system or deleted on the remote server after copied. So please give me a suggestion how to delete that file on remote server using PSCP. -- Thanks, Mohan |
|
||||
|
Thanks, I will use PSFTP instead of PSCP.
I have few questions if i use PSFTP I am using the below syntax to connect to server, psftp.exe -l testlogin -pw testpassword -b script.bat host.name.net all my file movement code in script.bat script.bat contains: cd SERVER/GETFILE lcd C:\INBOUND get Test one.txt quit 1. How to get latest file from the server, example i am using test one.txt 2. How to get return codes from the script.bat 3. How to rename file name "Test one.txt" to "YYYYMMDDHHDDSS.txt" when GET 4. How to rename file name "YYYYMMDDHHMMSS.txt" to "Test one.txt" when PUT Can you please clear my questions i can do all these using PSCP but, when i use code in the script.bat it doesn't recognizes keywords like "@ echo off" "IF" "SET etc. If i have a way to delete file using PSCP, or any idea to delete that file from server from the same script program i dont have to change all the code again. -- Thanks Mohan |
|
||||
|
The renaming of the files should be done by the batch file before / after the call to the psftp program. It does the transfer, it doesn't have to do everything else, that is why you have a batch file. The script.bat file is instructions for psftp. The place for the other instructions should be in the .bat file that calls psftp. To make things clearer, rename script.bat to script.spftp. This is not a .bat file so should not be labeled as a .bat file!
|
|
||||
|
Can we delete file using PSCP?
Use PSCP.EXE to get the file and PSFTP.EXE to delete after checking the return code.
PSCSP.EXE [options] IF “%ERRORLEVEL%” == “1” GOTO ERROR PSFTP.EXE [options] -b del.batch GOTO END :ERROR ECHO "There was an error getting the file." REM Use blat.exe to send emails. SourceForge.net: Blat - A Win32 Command Line SMTP Mailer :END |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|