How to increment a value appended to another value in a shell script

Posted by Sitati on Ask Ubuntu See other posts from Ask Ubuntu or by Sitati
Published on 2012-08-28T14:04:40Z Indexed on 2012/08/28 15:50 UTC
Read the original article Hit count: 262

Filed under:

I have a shell script that executes a backup program and saves the output in a folder. I would like to update the name of the output folder every time the shell script run. In the end I want to have many files with different names like this:

innobackupex --user=root --password=@g@1n --database="open_cart" /var/backup/backup_1 --no-timestamp

And after running the shell script again:

innobackupex --user=root --password=@g@1n --database="open_cart" /var/backup/backup_2 --no-timestamp

© Ask Ubuntu or respective owner

Related posts about shell-scripting