LINUX LITE 7.2 FINAL RELEASED - SEE RELEASE ANNOUNCEMENTS SECTION FOR DETAILS


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cronjob for a script
#2
Hello Moltke,

I haven't done this before, so it is just results from searches, I hope they help a bit though in finding the solution -

https://crontab.guru/

I used to make theĀ  below -

Code:
0 1 * 1-12 0


It will do the task at 01:00 hours on Sunday in every months from January to December.
It says for Sundays if you wish you can use instead of , 0, sun.
I am unsure if whether if a users week setting begins on Sunday or Monday may alter the numerical codes or if the crontab.guru bases this on using a geolocation script of the visitor, so I can see where using the day name in the week may be of use if it turns out to be presenting a difficulty.


Now the time is done it needs the command -
Code:
cp /origin /destination

example

Code:
0 1 * 1-12 0 cp /path/to/directory /path/to/destination

I also found this link about using rsync for this type of task, I have not used or learnt about rsync yet so its just search result info. (I changed it to add the cron info from the beginning of the post)

https://serverfault.com/questions/259938...ily/259949


Code:
0 1 * 1-12 0 /usr/bin/rsync -a /origin /destination
Reply


Messages In This Thread
Cronjob for a script - by Moltke - 09-18-2018, 08:39 PM
Re: Cronjob for a script - by bitsnpcs - 09-18-2018, 10:20 PM
Re: Cronjob for a script - by Moltke - 09-18-2018, 11:43 PM
Re: Cronjob for a script - by bitsnpcs - 09-18-2018, 11:48 PM
Re: Cronjob for a script - by Moltke - 09-18-2018, 11:57 PM
Re: Cronjob for a script - by bitsnpcs - 09-19-2018, 12:46 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)