I have this small script which basically do rsync of files between to remote server. ssh key has been generated for authentication.
only this is present in the script
rsync /root/Desktop/cpfies/files/*.xls user@host:root/Desktop/cpfies/moved
basically what I want to create is a log method for this script not to fancy or anything ...only this... if the connection is lost and the file is not sent it comes in my log saying "File not sent connection not established"
also if the files has been sent it shows me in the logs successfully sent.
or if the host or the user is wrong it show in my log.
Thanks and Regards, Sagar Mandal
rsync
okay? Then you can just redirect it (includingstderr
) to your logfile.