Script to move files from one host to another

b3divere

New Member
Joined
Jan 3, 2023
Messages
1
Reaction score
0
Credits
12
Hey guys could you help me with a script ?

I need to create a script to move files 1 and 2 from host A to host B daily, and it needs to be automatically.

How that script should be done ?

Thank you.
 


KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
8,549
Reaction score
7,304
Credits
69,523
This looks like schoolwork.

I am not sure I'd go for a script. If possible, I'd just take the easy route.

I'd use SSH, SCP, and cron.



I do not yet have a cron article, but there are many of them.
 

osprey

Well-Known Member
Joined
Apr 15, 2022
Messages
541
Reaction score
450
Credits
4,997
b3divere wrote:
....
a script to move files 1 and 2 from host A to host B daily
....
How that script should be done ?

You could look at rsync for transfer of files, cron or systemd timers for running the transfer daily, and put the commands in a file whose first line is #!/bin/bash or #!/bin/sh, to create the script. You could read the relevant man pages for the commands, or search online for details of each step.
 
MALIBAL Linux Laptops

Linux Laptops Custom Built for You
MALIBAL is an innovative computer manufacturer that produces high-performance, custom laptops for Linux.

For more info, visit: https://www.malibal.com

Members online


Latest posts

Top