Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
well sounds like you are on the right track with rsync, but we need more info. if you are unsuccessful at mounting the sftp share via fstab what else have you tried? have you looked into autofs? also keep in mind that if you can manually mount the sftp share you dont need to have it mounted for rsync to work as rsync will run over ssh connection just as sftp share does.
use code flags, post the exact output errors and the code you are using to attempt to get your rsync to run. also this is a job for cron.
always best to put it into a simple little script, put your path in your crontab, and run it from cron. see my first post.
you might also want to consider building in error checking and logging so that data can be verified it was transmitted and you can use the logging down the road if something happens for trouble shooting.
I had problem over the weekend, its looks like that over some time, i lose connection to sftp.
So when schedule try to run my command, it just create new folders, becuse sftp is not mounted.
How can i mount this sftp, to stay connected?
If i add "-o reconnect", will this do the work:
sshfs user@backup.si:/backup /media/server/ -o reconnect
this is where the script will come in handy. create a bash script that verifies if the share is mounted, if not mount it, then perform the transfer via rsync. confirm the transfer then exit program.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.