cancel
Showing results for 
Search instead for 
Did you mean: 

Adding timestamp to Archive folder name

Former Member
0 Kudos

Hi All,

I need to add the current date to the archive folder name of my file sender adapter, so that files are archived in folders based on the date on which they are picked.

Can this be achieved?

Regards,

Diptee

Accepted Solutions (0)

Answers (4)

Answers (4)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>Can this be achieved?

Writing a script for adding timestamp to archive folder is better option.

Former Member
0 Kudos

Thanks All,

Request you to give some pointers on how I can pass the name of the file being picked to my script as a parameter? Exact code lines would be appreciated.

Do I need to have the ASMA properties on?

Regards,

Diptee

prasanthi_chavala
Active Contributor
0 Kudos

Diptee,

I am not sure if there is any easy way of passing filename directly to script which is called from OS.

The other work around i can see here is...have a temp archive folder where your sender communication channel will archive the file adding tmpstmp in temp archive folder and then call a script and read the file name in the temp archive directory and make new archive directory with the archived file name and move the file from temp to new archive directory.

In this way you can have your files archived in the directories which tmpstmp too.

you just need to use simple commands to read the filename and creating directory and moving the file...

Thanks,

Prasanthi.

Former Member
0 Kudos

Hi Diptee,

Running an OS script would be the easiest solution here.

Thanks,

Vikash

Former Member
0 Kudos

Hi,

Although it is not possible to create folders based on current date using File Adapter, you can very well use an unix script.

Run a shell script from file sender adapter before or after processing depending upon your requirement.

Regards

Krish

Former Member
0 Kudos

Thanks Krish,

I was thinking of a script myself; however, posted this thread to know of any options.

In case I have the archive folder on another server in the same network, can I also connect it through the script?

Regards,

Diptee

Former Member
0 Kudos

Hi Deeptee,

I would always recommend archiving within the same server where the File sender adapter is accessing.

Although it would be possible via script to pick up a file and transfer it to another server, I would not want to complex the scenario esepcially when the script is running via PI trigger.

Always keep the scenario as simple as it is cos monitoring would be always difficult with respect to scripts.

I would still recommen having a simple folder and archive all the files by adding timestamp. You can still view all the files based on Date/Time.

It is just a suggestion!

Regards

Krish

rajasekhar_reddy14
Active Contributor
0 Kudos

other alternative adding one more receiver file communication channel and developing one to one mapping and write dynmic udf to add time stamp to archive folder.

rajasekhar_reddy14
Active Contributor
0 Kudos

if you want to add system date to archive file very much possible and straight forward but adding date to folder not possible i think.