simple linux bash script (with curl, file sync, email, openvpn)


I need a simple bash-script what does the following:

1) There is a path [TARGET] on the local file system defined as a variable at the beginning of the script.

2) It creates a directory (name = current date YYYY-MM-DD) within the [TARGET].

3) It downloads (curl) two (or more) files from different remote locations. The locations are https://... with basic htaccess auth and puts those files in [TARGET]/[CURDATE] . The complete URL, username and password can be hardcoded inside the script. Please write a function so I can add more locations on my own.

4) It establishes an open-vpn connection ([login to view URL], [login to view URL] files are in the same directory as the script is, username and password are given and can be hardcoded in the script)

5) It does the same as in 2) for another remote file which is only accessible over the vpn connection (https://192.168....)

6) It has to sync a remote directory which is also only accessible over the vpn connection (by FTP connection). The content of the directory is quite big (10GB) with few changes, the files should be stored in a tmp directory on the local machine. The sync is ONE WAY from the remote directory -> local directory. All the files deleted in the remote directory should be deleted in the local directory. Not other way around.

7) After the sync it should zip all the files inside the tmp directory from 6) and put the zipped file in the [TARGET]/[CURDATE]

8) disconnect from open vpn

9) If it is SATURDAY OR the 1. of the month it should download another remote file like in 2)

10) All directories older than 14 days created in [TARGET] should be deleted EXPECT of all directories created on the 1. of the month.

11) The script should send an email by SMTP (over TLS, receiver, server, username and password can be hardcored) with the following content: Every file in [TARGET]/[CURDATE] with its file size: [login to view URL] ... 2048KB ... [login to view URL] ....1024KB...

12) If it is the first of the month the directory created ([TARGET]/[CURDATE]) with all files in it should be uploaded to another target (by SFTP)

13) Thats it :-)

Unfourtunately I can not grant you access to the local server or to the remote file locations so you have to test the script on your machine. Please list all the dependencies / programs that I have to install on the local machine by apt-get. The local system is ubuntu 20 LTS. I am a software developer (with poor linux console skills) and can make some small modifications and adjust the script. I just need the complete working script (tested in your environment) ASAP and put in all the locations, usernames and so on.

PLEASE: Read the instructions carefully. All of the steps from 1) to 13) has to be done in this order. After the end of the script the openvpn connection must be terminated.

Compétences : Linux, Script Shell, Ubuntu

en voir plus : mysql linux bash script, simple php bash script gnu translation, linux bash script delete, openvpn run script after connect windows, openvpn email notification, openvpn client-connect script variables, openvpn script-security, bash scripts github, openvpn client-connect script example, openvpn login script, openvpn up script, script read file include email, linux bash script process apache access log, bash script parse file sed, linux bash script sample sed, linux bash script log, linux bash script ftp, bash script lines file scan, linux bash script installer mysql, bash script csv file comma parsing

Concernant l'employeur :
( 5 commentaires ) Bielefeld, Germany

Nº du projet : #27504895

15 freelance font une offre moyenne de €132 pour ce travail


Hi, Please initiate a chat for further project discussion. I have 8 years plus experience in DevOps, SysOps, Cloud infrastructure deployement on both Linux and Windows, Ansible, Shell / Bash scripting , AWX scripting Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% EUR en 2 jours
(44 Commentaires)

Hello, I'm expert in the same profession. I've more than 7+ years of experience. I can do this task easily on time. I'll create an amazing project. Also have a look over my profile in order to get to know about me more Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% EUR en 2 jours
(29 Commentaires)

yes i got your 1 to 13 task i need 4 to 5 days and my price 300erous ok ?

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% EUR en 4 jours
(13 Commentaires)

Hello, I have a great experience in developing shell scripts. - Yes, you will be able to edit the script yourself, there will be nothing complicated about it. It will be something like: download URL username password Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% EUR en 3 jours
(7 Commentaires)
(9 Commentaires)

Hi, I have 20+ years experience in Linux system admin. I can do what you need. Feel free to discuss further detail in chat. Thank you.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% EUR en 5 jours
(7 Commentaires)

Hey, I have read your requirements and this is something I had done recently for my code base to update a remote codebase when I make changes to my local code in an IDE. I think what you need is pretty similar and look Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% EUR en 1 jour
(3 Commentaires)

Hi, Can I Start yours immediately? Thanks for sharing your project requirement with us. It will be our great pleasure to work on your project. I have checked your requirement, yes we can do it because we already work o Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% EUR en 1 jour
(1 Évaluation)

I am a Linux admin have 7 years of experience in this field. I worked in webhosting industry and manage datacenter from remote. I give full server management support and I can do this for you . I also have experience w Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% EUR en 1 jour
(2 Commentaires)

I CAN COMPLETE YOUR PROJECT EASILY Hello, I am programmer with enough experiences on C/C++ for 13 years. C/C++ is nice programming language and I am majoring on it for long years so I have confident to complete your pr Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% EUR en 7 jours
(0 Commentaires)

Hello, I have experience in bash/shell script (Linux, CentOS, Ubuntu,...). I think your requirement is the same with my day work. I can do that for you, Thanks

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% EUR en 7 jours
(0 Commentaires)

Shell script writing is my profession, I could help you with a script which will perform all 13 steps in a flash.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% EUR en 3 jours
(0 Commentaires)

Hi, If you're a dev why not implement it in nodejs or python on windows... and transfer the script to linux? maybe even as a docker image where the dest folder is mounted? Full time dev since 2004. frontend + backend Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% EUR en 1 jour
(0 Commentaires)

I am expert in writing bash script ,I have already wrote almost same bash script as part of our project requirement, I can deliver you in 1 day

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% EUR en 1 jour
(0 Commentaires)

from what you said I got that you want to use two types of downloading one using VPN and the other without it. The one you want to use VPN with you also want to SYNACK the files in the server side using ftp and compres Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% EUR en 2 jours
(0 Commentaires)