Issues related to configuring your network
Post Reply
Posts: 50
Joined: 2016/02/24 19:11:41


Post by nmrdukeman » 2020/08/18 15:58:50

I need to remote backup files from three different /home/user /directories on a client to the data server computer with the same /home/user directories. I have already set up passwordless ssh between all these accounts in order to use rsync to fetch the data from one /home/user (client) to /home/user (server).

I know I can put a cron script on each /home/user to run rsync.

Can I, as a root, to create a single script (with root ownership) in my home directory /home/user1 to run, as root, something like:
rsync ssh -p /home/user1/ (source) ipaddress:/home/user1 (destination)
rsync ssh -p /home/user2/ ipaddress:/home/user2
rsync ssh -p /home/user3/ ipaddress:/home/user3

The reason I want to do this is that as soon as user 1 is done, it will execute user2 and so on.

Thanks for your help

Posts: 370
Joined: 2019/10/09 12:31:40

Re: Cron

Post by BShT » 2020/08/18 16:37:16

you can run it as root or you can log as user and edit users crontab with crontab -e

there is no username at user crontab -e

* * * * * /yourcommand

at /etc/crontab
* * * * * username /yourcommand

Post Reply

Return to “CentOS 8 - Networking Support”