Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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/

share|improve this answer
    
no luck, thanks though –  Paperghost Jun 15 '12 at 9:45
    
Can you name your solaris then? Solaris 8 has no such possibilities at all: johnmeister.com/CS/UNIX/SOLARIS/MAN/date-man.html –  kworr Jun 15 '12 at 9:55
    
Solaris 11, i know but i thought solaris 11 might do –  Paperghost Jun 15 '12 at 10:17
    
You have no luck with this one. –  kworr Jun 15 '12 at 13:39
    
the tools come with solaris 11, don't think im going to have much luck with this one –  Paperghost Jun 15 '12 at 14:17
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.