Ubuntu 12.04 Cronjob failed to mount ftp share using gvfs-mount
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.
Ubuntu 12.04 Cronjob failed to mount ftp share using gvfs-mount
Currently I have task to backup some data from ftp server to local pc for every hour in every day.
Say the server is 10.10.10.10 with credentials username and password
When I open the ftp server through Firefox it displays root of the ftp user (eg. /home/username), but when I open it through Nautilus it displays root of the ftp server (eg. /).
I dont know exactly what OS server is running (I think it is Solaris) and the settings, I just given the credentials.
The problem is data that I need to backup is located at the root of the ftp server (eg. /backup), so I have to mount it like Nautilus does.
Also I have tried curlftpfs, but it mounts ftp server like Firefox does.
I googled and found that to mount ftp server like Nautilus does was using gvfs-mount
So I wrote some shell script to automate this task. Here what I got :
I named the script as backup.sh, added execute bit, run it from Terminal (eg. ./backup.sh), and nothing unexpected was happened.
So I added that script to my cronjob (eg. 0 * * * * /home/myusername/backup.sh 2>&1 | /usr/bin/logger -t "TEST_CRONJOB"), but the ftp was not mounted.
When I checked the log, the error was :
TEST_CRONJOB: Error mounting location: volume doesn't implement mount
TEST_CRONJOB: Error finding enclosing mount: Containing mount does not exist
So, my question is : Is there something I need to configure before using cron and gvfs-mount ?
Thanks in advance
If you are already logged in, thus I believe gvfs is already mounted. Trying to mount over a mount with gvfs doesn't work as gvfs doesn't support the mount function.
If you are already logged in, thus I believe gvfs is already mounted. Trying to mount over a mount with gvfs doesn't work as gvfs doesn't support the mount function.
Thank for your reply, but I havent logged in yet (do you mean to ftp server?) and I dont have any mounted ftp in my .gvfs folder
my opinion is that it would be more secure and easier to use scp with private-key-encryption. there is also sshfs which will mount remote directories using ssh.
The place you are trying to mount doesn't allow you to mount.
Since all of this appears to be taking place on your local machine, it would be there.
Is this about permission?
I have chown'd and chgrp'd the the mount point on my local pc.
Quote:
Originally Posted by schneidz
my opinion is that it would be more secure and easier to use scp with private-key-encryption. there is also sshfs which will mount remote directories using ssh.
I havent tried sshfs yet because my work is off right now, but I have tried using scp on my another local pc.
Here what I got :
I added that script to cronjob and it doesnt work.
The report I got :
TEST_CRONJOB: Permission denied, please try again.#015
TEST_CRONJOB: Permission denied, please try again.#015
TEST_CRONJOB: Permission denied (publickey,password).#015
When I tried it on Terminal, it seems that echo didnt pipe password to scp.
Any ideas?
No. It is about functionality not implemented. gvfs is not a real filesystem. It is a process that interprets filesystem requests (passed via FUSE). and the mount request is not supported.
Quote:
I have chown'd and chgrp'd the the mount point on my local pc.
...
I havent tried sshfs yet because my work is off right now, but I have tried using scp on my another local pc.
I would expect sshfs to work better as the mount is done on the local system, using the users directory (I believe it creates/can create the local directory mountpoint), and the file requests are passed to the sshfs service running on the remote end, thus no mount on the remote.
I added that script to cronjob and it doesnt work.
The report I got :
TEST_CRONJOB: Permission denied, please try again.#015
TEST_CRONJOB: Permission denied, please try again.#015
TEST_CRONJOB: Permission denied (publickey,password).#015
When I tried it on Terminal, it seems that echo didnt pipe password to scp.
Any ideas?
Echo cannot. ssh/scp use a secure channel to read the password by opening /dev/tty. chron jobs don't have a tty... The "permission denied" is because the attempt to open /dev/tty fails.
I added that script to cronjob and it doesnt work.
The report I got :
TEST_CRONJOB: Permission denied, please try again.#015
TEST_CRONJOB: Permission denied, please try again.#015
TEST_CRONJOB: Permission denied (publickey,password).#015
When I tried it on Terminal, it seems that echo didnt pipe password to scp.
Any ideas?
No. It is about functionality not implemented. gvfs is not a real filesystem. It is a process that interprets filesystem requests (passed via FUSE). and the mount request is not supported.
I would expect sshfs to work better as the mount is done on the local system, using the users directory (I believe it creates/can create the local directory mountpoint), and the file requests are passed to the sshfs service running on the remote end, thus no mount on the remote.
Echo cannot. ssh/scp use a secure channel to read the password by opening /dev/tty. chron jobs don't have a tty... The "permission denied" is because the attempt to open /dev/tty fails.
I have tried schneidz link and it worked on my local network. I will try it next day on my work.
Thanks
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.