Expand my Community achievements bar.

SOLVED

1. How to move a file on SFTP from one input to Archive via technical workflow in ACC and 2. how to delete file from Archive after 30 days

Avatar

Level 2

Hi All,

 

I am importing the file data from SFTP using file transfer activity loading into schema after loading i want to move those file to Archive folder after 30 days i want to delete it, kindly suggest me if we have any script please provide 

 

Thank You in advance

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @rudraPraveenKumar 

 

To delete the file you can use the linux command "find (file sftp location) -type f -mtime +30 -delete" in the Javascript.

For Archival you can follow @ParthaSarathy  solution and also refer this documentation.

 

Regards

A

View solution in original post

5 Replies

Avatar

Community Advisor

HI @rudraPraveenKumar ,

Create a folder for 'Archive' in your SFTP.

In File transfer activity > File Historization setting > storage directory > provide the sftp path for archive folder

ParthaSarathy_0-1689823945781.png

Now once the file is processed, the file will be stored in the Archived folder

Avatar

Level 2

Hi @ParthaSarathy,

 

As per above i have tried but the file is not moving to Archive folder even after the processed completed.

 

can you have any other suggestions

 

Thank You

Avatar

Correct answer by
Community Advisor

Hi @rudraPraveenKumar 

 

To delete the file you can use the linux command "find (file sftp location) -type f -mtime +30 -delete" in the Javascript.

For Archival you can follow @ParthaSarathy  solution and also refer this documentation.

 

Regards

A

Avatar

Community Advisor

Hi @rudraPraveenKumar ,

 

Please check the permissions given to the "Archived" Folder Created in the Directory.

LakshmiPravallika_0-1689861525104.png

 

It should have all Read/Write/Execute Permissions. Also for testing the Archiving, if the File Transfer activity didn't work, you can alternatively use the below unix command as shown below in JavaScript activity:

 

execCommand('mv InputFileFullPath ArchivedFolderFullPath');

 

Regards,

Pravallika.

Avatar

Administrator

Hi @rudraPraveenKumar,

Were you able to resolve this query with the help of the given solutions or do you still need more help here? Do let us know. In case the given solutions were helpful, then kindly choose the one that helped you the most as the 'Correct Reply'.
Thanks!



Sukrity Wadhwa