Script for moving&creating folders by month
by hatfani from LinuxQuestions.org on (#4T637)
I have 2 servers (centos 7). server 6 and server 1. In server 1 I have new directories created every month by the name of the month:
Name_sep2019
NameT_sep2019
Name_oct2019
NameT_oct2019
I want to move from server 1 ,every 2 months, the folders that were created 2 month before.
For example: when November comes, I'd like September folders to be moved to server 6.
I'd like also to create every 2 month a directory in server 6 arranged by month, so that the above folders will move inside.
For example: create by the beginning of November a "September" directory so that 'Name_sep2019' & 'NameT_sep2019' will move inside.
I do know that I need to use rsync command for the moving itself, but as for the other conditions - I don't know nothing.
Any help will be very much appreciated, Thank you!


Name_sep2019
NameT_sep2019
Name_oct2019
NameT_oct2019
I want to move from server 1 ,every 2 months, the folders that were created 2 month before.
For example: when November comes, I'd like September folders to be moved to server 6.
I'd like also to create every 2 month a directory in server 6 arranged by month, so that the above folders will move inside.
For example: create by the beginning of November a "September" directory so that 'Name_sep2019' & 'NameT_sep2019' will move inside.
I do know that I need to use rsync command for the moving itself, but as for the other conditions - I don't know nothing.
Any help will be very much appreciated, Thank you!