Quantcast
Channel: Append current timestamp on files name from background running command - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2

Append current timestamp on files name from background running command

0
0

Following is command that I have used in bash script and it is run on background:

sshpass -p prakash12 ssh -t -p $1 prakash@localhost './test_new_update_script.sh > /home/log/unit_update_output.log 2> /home/log/unit_update_error.log < /dev/null | echo $! > /home/log/unit_update_pids &'

This command created 3 files at run time i.e. unit_update_output.log, unit_update_error.log and unit_update_pids. And print the related info. in that files.

I want to append the current timestamp at the end of each 3 files name.

Like: unit_update_output-2014-04-08T22-15-02.log "2014-04-08T22-15-02" this is current timestamp.

The above command is running on background:

So how can I do this?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images