bash script - linux

bash script - linux

Closed - This job posting has been filled.

Job Description

Simple bash code to insert the verbose output of lftp into mysql.


lftp
http://lftp.yar.ru/lftp-man.html

#!/bin/bash
lftp -u username,password ftphost << EOF
mirror -Re --use-cache /home/ /backup/
mirror -Re --use-cache /etc/ /backup/
mirror -Re --use-cache /var/www/ /backup/
quit 0
EOF

Using shell script to insert data into remote MYSQL database
http://stackoverflow.com/questions/3900496/using-shell-script-to-insert-data-into-remote-mysql-database

mysql --host=randomhost --user=randomuser --password=randompass randomdb
insert into table (field1,field2,field3) values('http://www.site.com/$hash','$file','$size');

Couple of other things;

- script needs to run every X minutes, however, should not run if already running
- perhaps mysql batch insert?
- ideally some knowledge/experience of lftp commands would be very useful

Thank you.

---
Skills: server-administration, linux