Help converting my Script


 
Thread Tools Search this Thread
Operating Systems Solaris Help converting my Script
# 1  
Old 06-16-2012
Help converting my Script

So i have been asked to write a script for a friend who has a server running solaris 11. My problem is the correct syntax i can't seem to get it work with the follow code, i have read through the date man page and found no work around
Below is the code for part of the rsync script.
The code i need to convert is `date --date=yesterday +\%Y-\%m-\%d`-`date --date=yesterday +\%A` this tells rsync to look at yesterdays date but doesn't work in solaris
Code:
#!/bin/sh
rsync -avz /mnt/backups/`date --date=yesterday +\%Y-\%m-\%d`-`date --date=yesterday +\%A`/server1/ /mnt/backups/`date +\%Y-\%m-\%d`-`date +\%A`/server1/


Last edited by paperghost; 06-16-2012 at 08:21 AM.. Reason: removed script
# 2  
Old 06-16-2012
Make sure that the date command is the GNU date command in rsync snippet posted above or specify the full path to GNU date command.
# 3  
Old 06-16-2012
Quote:
Originally Posted by h@foorsa.biz
Make sure that the date command is the GNU date command in rsync snippet posted above or specify the full path to GNU date command.
I am currently testing that part of the code and can not confirm that it is working
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting macro to bash script

Gents, Please can you help me with this. When column 49 == 2 Before X 4714 14710 69445.00 19257.001 1218 12271 69596.00 19460.00 19478.001 X 4714 14710 69445.00 19257.001 1228 12292 69596.00 19480.00 19480.001 After X 4714 14710 69445.00 19257.001 1218... (1 Reply)
Discussion started by: jiam912
1 Replies

2. Shell Programming and Scripting

Converting awk script from bash to csh

I have the following script set up and working properly in bash. It basically copies a set of lines which match "AS1100002" from one file and replaces the same lines in another file. awk -vN=AS1100002* 'NR==FNR { if($1 ~ N)K=$0; next } { if($1 in K) $0=K; print }' $datadir/file1... (7 Replies)
Discussion started by: ncwxpanther
7 Replies

3. Shell Programming and Scripting

Script for converting to xls and to mail the same

i have installed CENTOS in VMware. I want the linux command to run in CENTOS. The command is to select data's from Event table(our table name) convert into .xls and mail every 2hrs. Can you please help me in writing this script. Thanks, Shobana (1 Reply)
Discussion started by: shobana praveen
1 Replies

4. Shell Programming and Scripting

Converting a shell script to program

Hi I am new in programming. I have written a shell code, but i want to secure my code. I have tried SHC. It is converting it to binary, but can be converted in plain text again by core dump. I have tried to convert it in rpm by "rpmbuild -bb my.spec" option but the result is same. ... (4 Replies)
Discussion started by: Priy
4 Replies

5. Shell Programming and Scripting

Please help me with converting the below bash script in C shell script

#!/bin/sh # $Header: hot_database_backup.sh,v 1.2 2002/08/06 23:51:42 $ # #bcpyrght #*************************************************************************** #* $VRTScprght: Copyright 1993 - 2007 Symantec Corporation, All Rights Reserved $ *... (2 Replies)
Discussion started by: apade
2 Replies

6. Shell Programming and Scripting

Converting rows to columns using shell script

I have a script which converts rows to columns. file_name=$1 mailid=$2 #CREATE BACKUP OF ORIGINAL FILE #cp ${file_name}.xlsx ${file_name}_temp.xlsx #tr '\t' '|' < ${file_name}_temp.xlsx > ${file_name}_temp.csv #rm ${file_name}_temp.xlsx pivot_row=`head -1 ${file_name}` sed 1d... (3 Replies)
Discussion started by: andy538
3 Replies

7. Shell Programming and Scripting

Converting csh script to Pyhton

I am trying to call this python script tdarwin.py -nxz=23x35 and should take the -nxz and take the values 23 and 35 to two variables. But am getting the error "option -n not recognized" long_opts= try: optlist, args = getopt.getopt(sys.argv, "", long_opts) ... (2 Replies)
Discussion started by: kristinu
2 Replies

8. Shell Programming and Scripting

Converting Shell Script to HTML

Hi, Im new to shell scripting. My task is to convert shell script feed into html, so basically I have a lot of information in shell script and I want to convert it html. I know you can simply convert the information by hand, but is there any simpler way? Thank you Dave (3 Replies)
Discussion started by: davwel
3 Replies

9. Shell Programming and Scripting

Converting bash script to csh

Hi, I'm a beginner in scripting and I recently wrote a bash script that would've worked fine until I realized it needed to be written in csh. Could someone please show me how to correctly change the syntax from bash to csh in this script? Any help will be greatly appreciated. I can provide more... (4 Replies)
Discussion started by: Kweekwom
4 Replies

10. Shell Programming and Scripting

unix script for converting a decimal to binary

Could anybody please help me in writing a script in unix for converting a decimal number to binary number. (3 Replies)
Discussion started by: softy
3 Replies
Login or Register to Ask a Question