0

I’m trying to run the following command

rsync -avz /mnt/backups/`date \
    --date=yesterday +\%Y-\%m-\%d`-`date \
    --date=yesterday +\%A`/server1/ /mnt/backups/`date \
        +\%Y-\%m-\%d`-`date +\%A`/server1/

The problem is I don't know how to change this from Ubuntu syntax to solaris which I have been asked to write a rsync script for. It doesn't like the date --date=yesterday +\%Y-\%m-\%d-date --date=yesterday +\%Apart. How would I write this part of the code so solaris understand it, I have had a read of the man page but couldn't get it to work

Henk Langeveld
  • 1,314
  • 10
  • 25
Paperghost
  • 70
  • 8

1 Answers1

0

Solaris has some old and crispy userland. It has no options for changing date while formatting.

http://docs.oracle.com/cd/E23824_01/html/821-1461/date-1.html#scrolltoc

However you can switch to GNU tools: http://www.sunsolarisadmin.com/solaris-11/gnu-tools-out-of-the-box-in-solaris-11/

kworr
  • 1,055
  • 8
  • 14