WinSCP - ignore single directory during sync - winscp

I have a directory on a server that needs to synchronize its contents to a client. It is set to delete files on the client that have also been deleted from the directory that is to be synced from the server.
I want to ignore a specific directory, so it does not delete its contents on the client.
The following script (located on the client) currently deletes the contents located in /files/synced/oss/test/ but I want that directory to keep its contents on the client.
option exclude "Thumbs.db; /files/synced/oss/test/"
synchronize local -delete "D:\files" "/files/synced"

If I understand your question correctly, you do not want to exclude a remote folder /files/synced/oss/test/.
You want to exclude a local folder D:\files\oss\test\.
Also note that the option exclude has been deprecated, use -filemask switch instead.
synchronize local -delete -filemask="| Thumbs.db; D:\files\oss\test\" "D:\files" "/files/synced"

Related

How to "unsync" files from perforce client?

I have files in my perforce client which I no longer need.
Is there a way to remove the files from my client to free up the space?
I don't want to delete the client and create a new one.
Thanks in advance.
You can sync to any revision, including #none. To temporarily remove a directory (e.g. the current directory, ...) from your client just do:
p4 sync ...#none
If you want to more permanently remove the directory from your client (so it won't come back even if you re-sync your entire workspace), remove it from your client's View:
View:
//depot/... //my-client/...
-//depot/some_directory/... //my-client/some_directory/...

Add prefix or suffix to filename while streaming the file using GET gateway

I want to add the temporary prefix or suffix while streaming the file from a remote directory using SFTP.
I have tried to add temporaryFileSuffix to outboundGateway while streaming the file but it is not adding any suffix later I checked it is documented that
"Set the temporary suffix to use when transferring files to the remote system."
.handle(Sftp.outboundGateway(sftpSessionFactory(), GET, "payload.remoteDirectory + payload.filename").options(STREAM).temporaryFileSuffix("_reading"))
Do I need to Rename the file using Rename gateway or there is a better way to do it.
Your question is not clear - do you mean you want to copy it with a temporary name locally? Or, do you mean you want to rename it on the remote server before copying?
If the former, use the localFilenameGeneratorExpression.
If the latter, you would have to use the MV gateway first.

SFTP set upload order by local file date

Reading SFTP command line shell seems there is no flag to upload entire
folders to remote server sending local files according to the date of the last modification so that the recently modified local files are the last to be uploaded remotely.
I tried to change the date with touch -t but sftp always seems to follow the alphabetical order.
I can not create an ordered list and send it through a batch file because my need is to send whole folders not single file [ i.e. put foldername ]
My need now is how to upload an entire folder that contains some XML files and only one of them having a random name that I know in advance must be sent to the remote server as last.
Thanks in advance.
My need now is how to upload an entire folder that contains some XML files and only one of them having a random name that I know in advance must be sent to the remote server as last.
Move the one specific local file away (to a temporary folder)
Upload the rest of the files
Upload the specific local file explicitly
Move the specific local file back.

Having trouble deleting client

I'm getting this error while trying to delete a client named 'test':
Client 'test' has files opened. To delete the client, revert any opened files and delete any pending changes first. An administrator may specify -f to force the delete of another user's client.
I try p4 opened and it shows:
//TestRepo/test/TestA.java#1 - edit default change (ktext)
//TestRepo/test/TestB.java#1 - edit default change (ktext)
How do I delete these files so that I'm able to delete the client?
Run p4 revert //TestRepo/test/TestA.java //TestRepo/test/TestB.java from within the client first.

perforce client spec - making different depot paths map to the same client workspace path

I want to create a client with the following view:
//depot/location1/main/... //myclient/main/...
//depot/location2/main/... //myclient/main/...
No files and directories are common between //depot/location1/main/..., and //depot/location2/main/...
But when I do p4 sync, it only syncs from //depot/location2/main/...
How can I make it sync from both locations?
Use this
//depot/location1/main/... //myclient/main/...
+//depot/location2/main/... //myclient/main/...
The plus does what you are looking for, it tells perforce to add the files from that depot location to an already defined workspace location.

Resources