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 | Community
Skip to main content
Level 2
July 19, 2023
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

  • July 19, 2023
  • 4 replies
  • 1600 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by AkshayAnand

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

4 replies

ParthaSarathy
Community Advisor
Community Advisor
July 20, 2023

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

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

~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups
Level 2
July 20, 2023

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

AkshayAnand
Community Advisor
AkshayAnandCommunity AdvisorAccepted solution
Community Advisor
July 20, 2023

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

LakshmiPravallika
Community Advisor
Community Advisor
July 20, 2023

Hi @rudrapraveenkumar ,

 

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

 

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.

Sukrity_Wadhwa
Community Manager
Community Manager
August 24, 2023

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