i'm write a script for automation copying file with rsync from server-a to server-b this is my script :
#!/bin/bash NOW=$(date +"%Y-%m") rsync -au --ignore-existing /var/www/uploads/$NOW/* -e email@example.com:/var/www/uploads/$NOW/.
when we are going to an next month like from October to November , i get this error on my script :
rsync: mkdir "/var/www/uploads/2014-11/." failed: No such file or directory (2) rsync error: error in file IO (code 11) at main.c(605) [Receiver=3.0.9] rsync: connection unexpectedly closed (9 bytes received so far) [sender] rsync error: error in rsync protocol data stream (code 12) at io.c(605) [sender=3.0.9]
` how should i fix this error ? please help me