10-28-2013 08:49 AM - edited 03-01-2019 09:05 AM
I was wondering when generating a new file dependency can I do embedded unix commands?
For example, I wanted to check the exisitance of a file but with a date structure:
/home/test/`date +%Y-\%m-\%d`/testfolder/testfile.csv
Essentially, that gets todays date in a specific format for a directory name. Its the same as doing an "ls" on that path and seeing if it exists, except the shell will interpret the `date +%Y-\%m-\%d` portion and return the date in that format.
Is this possible within the context of a file dependency?
Thanks
10-28-2013 11:36 AM
You can use the Tidal System Date variable to accomplish this. Click the Variables button, System Variables, System Date, Date Format. This will insert the system date when Tidal starts the new scheduled day. This is probably at midnight, but if you have an offset schedule this could be at another time. The important thing to remember is the date is when the current day's schedule goes live, not the date when the job's dependencies are met.
You can also use the System Variable, Production Date, Date Format if you use an offset schedule. This will use the Production Date associated with the offset calendar. For example, if you have offset your schedule to start at 8am and the current date at 8am is 10/28, then the production date is 10/28 from 8am today until 7:59:59am tomorrow.
Thanks.
10-28-2013 12:18 PM
Thanks Tracy, That worked perfectly!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide