Sequential file name with Timestamp
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 126
- Joined: Thu Jul 01, 2010 11:39 pm
Sequential file name with Timestamp
Hi Guys,
I need to create a sequential file with the name as macDDMM.txt where DD is day and MM is the month.
I thought of two ways to do it. But both of them does not suits me.
One is through Sequence where you can use the Unix command mv. But sequence is needed only for this. So, i want to avoid it unless there is no other way.
Second is through a parameter and passing it to the filename. But i do not have the previlages to create parameters.
Can anybody help me in accomplish this in some other way.
Regards,
Magesh
I need to create a sequential file with the name as macDDMM.txt where DD is day and MM is the month.
I thought of two ways to do it. But both of them does not suits me.
One is through Sequence where you can use the Unix command mv. But sequence is needed only for this. So, i want to avoid it unless there is no other way.
Second is through a parameter and passing it to the filename. But i do not have the previlages to create parameters.
Can anybody help me in accomplish this in some other way.
Regards,
Magesh
Mac4rfree
-
- Participant
- Posts: 126
- Joined: Thu Jul 01, 2010 11:39 pm
-
- Participant
- Posts: 126
- Joined: Thu Jul 01, 2010 11:39 pm
I am getting an error with ExecSH.
This is what i gave
After-Job Routine : ExecSH
Input Value : mv Rej.txt Rej`date +'%m%d'`.txt
The mv command is working fine which i have tested it.
AFter the run, i am able to find the Rej.txt also which was created by the job.
Can anybody shed some light on where i am going wrong.
Thanks for your help in advance.
This is what i gave
After-Job Routine : ExecSH
Input Value : mv Rej.txt Rej`date +'%m%d'`.txt
The mv command is working fine which i have tested it.
AFter the run, i am able to find the Rej.txt also which was created by the job.
Can anybody shed some light on where i am going wrong.
Thanks for your help in advance.
Mac4rfree
-
- Participant
- Posts: 126
- Joined: Thu Jul 01, 2010 11:39 pm
Right, a full path not a relative path. That or 'cd' there first:
Code: Select all
cd target_directory && mv old new
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 126
- Joined: Thu Jul 01, 2010 11:39 pm
-
- Participant
- Posts: 126
- Joined: Thu Jul 01, 2010 11:39 pm