• We had to restore from a backup today after a failed software update. Backup was from 0000 EDT and restored it at 0800 EDT so we lost about 8hrs. Today is 07/20/2024. More info here.

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.
 


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.
 
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.
 

Members online

No members online now.

Top