[SOLVED] how to tranfer file @ boot via ftp on raspbian?
Linux - Embedded & Single-board computerThis forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.
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.
Hello,
I installed a camera on my raspberry pi.
It takes pictures via "motion" and avi files are created inn /home/pi/motion/video . you can find a good HowTo here http://jankarres.de/2013/12/raspberr...tion-tracking/
At each boot, I would like to tranfer all video files existing in that pi directory to /ftp://fritz.box/USBStickStorage/videofiles (fritz.box is my home router where an usb stick is attached) and delete them from the pi as soon the tranfer is successfully done. Has somebody any suggestion how to do it?
Attention: at boot, it takes approx 2 minutes before the raspberry pi is connecting to the home network via wifi; so, the copy/delete mechanism should not act immediatly at boot but wait till the raspberry is connected to the home network.
The next step could be: any new video should be copied to the home network then deleted if the copy was successfull.
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
I take it Fritz doesn't provide SSH access? If it does, use rsync
Assuming it does not...
ncftpput is an ftp batch utility for sending batch files. When the result code indicates no error, you can delete the local file.
Another utility, weex, is doing something like sync-over-ftp. It is very configurable and can delete source files IIRC.
Furthermore, I agree with TenTenths. Just build a cron job which periodically syncs the files. Then you can skip the complete copy-at-boot problem. The cron job just copies when it can.
As mentioned by the OP, his target device is a USB device attached to his router. A quick look at the documentation for a fritz.box would indicate that access to the storage is by FTP or "Media Server uPnP" only.
All file were transfered from my raspberry pi to the usb storage which is on my fritz.box router; alle files on the raspberry pi are deleted for more space.
Now, I will put that command in a cron job doing it every 2minutes; I will have a look for advice in the internet how to do it (I never used cron).
schneidz@xbmc:~$ tail .profile
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
#/home/schneidz/bin/masq.ksh &
(sleep 45 && /usr/bin/sshfs schneidz@mom:media/stuff hyper) &> /dev/null &
you can probably put the same in /etc/rc.local or add an @reboot entry in the users crontab.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.