I have 3 nginx web servers which make big access.log log files. I configured logrotate to rotate them when the size reaches 100mb and gzip them.

now i would like to move all the *.gz files at night to a backup CIFS location . does anyone has a bash script which would handle it?

link|improve this question

69% accept rate
i guess i was too fast to open a question. what i did was created a .crerentials file and put inside domain user and password username=john.smith password=123abc domain=MYDOMAIN chmod it to 500 make a bash script #!/bin/sh smbclient //servername/share -A /root/.credentials -c "lcd /var/log/nginx; prompt; recurse; mput .gz; " rm /var/log/nginx/.gz and a crontab is runnging it – Elgreco08 May 31 '11 at 8:27
feedback

1 Answer

up vote 1 down vote accepted

I guess I was too fast to open a question. What I did was created a .credentials file and put inside domain user and password

username=john.smith 
password=123abc domain=MYDOMAIN 

chmod it to 500 make a bash script

#!/bin/sh 
smbclient //servername/share -A /root/.credentials -c "lcd /var/log/nginx; prompt; recurse; mput .gz; " 
rm /var/log/nginx/.gz 

and a crontab is running it

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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