CentOS 5.3
I have a script file that works for backing up a repository and I am using rsync to copy the contents to the source directory.
I have a crontab job that runs every night at 12am that calls my script file. repos_backup.sh
rsync -razv dev@xx.xx.xx.xx:repos /home/backup_sys_user/repos_backup
However, this puts all the repositories in repos_backup directory. However, I am looking for a way to create a new directory based on the date the backup was done. So I should have a directory structure like this:
/repos_backup/10.10.2010
/11.10.2010
/12.10.2010
I haven’t done much scripting before, is there anyway to do this.
Many thanks for any advice,
Steve
You can use:
To get the current date (e.g. 10.10.2010)
To include it within a command, you can do:
Note that the those are tick marks.