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 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?

share|improve this question
    
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

1 Answer 1

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

share|improve this answer

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.