Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Noob help - cron job

Featured Replies

Hi all, I am trying to run rsync via a cron job from a local unRAID to a remote unRAID.  I can't for the life of me figure out where to place the rsync line to keep it persistent after reboot.  I did find a great rsync script in the forums but once again I'm not sure where to place the script.  I want this to run as a cron job so I don't have to worry unless there is an error.  I am very new to the Linux world so a great step by step how to would be great.  Thanks in advance Edawg

 

Sent from my SCH-R530U using Tapatalk 2

 

 

It sounds like you know what command(s) you want to run, just not how to keep the commands persistent?

 

If you just need to add one or 2 commands to cron on reboot, add the lines to your "/boot/config/go" file. Something like:

echo "0 */6 * * * rsync -avz /local/directory/location/ username@remoteHostName:/remote/directory/location/" >> /var/spool/cron/crontabs/root

 

If you have several lines to add to cron, create a file on your flash drive ("/boot/custom/mycron" for example), place the multiple commands in the "/boot/custom/mycron file" then add this line to "/boot/config/go":

cat /boot/custom/mycron >> /var/spool/cron/crontabs/root

 

If you need help with the specific commands, http://www.thegeekstuff.com/2010/09/rsync-command-examples/ has some good info on rsync. Or just update your post with your questions.

  • Author

Lainie thank you so much for the quick reply and the great examples.  I'm foing to try this out right now.  I'll post back my results.  Thanks again

Edawg

 

Sent from my SCH-R530U using Tapatalk 2

 

 

  • Author

Lainie I put everything together but for the "mycron" file what file format should i save it as?

 

Also when does this  "0 */6 * * *" execute?

 

Thanks Edawg

Lainie I put everything together but for the "mycron" file what file format should i save it as?

It is just a text file. If editing a text file in Windows, Notepad++ will allow you to save it in a Unix/Linux friendly format. When editing text files in Linux, I use vi (vi is installed on most Unix/Linux systems, but has a steep learning curve).

 

If you want to add text to a new file via command line Linux, http://www.centos.org/docs/2/rhl-gsg-en-7.2/s1-navigating-usingcat.html shows an quick way. First:

cat > /boot/custom/mycron

Next, enter any text you want in the file. When you are done, hold down the Ctrl key and the D key to go back to the command prompt. You can then check that the text is the way you want it by typing

cat /boot/custom/mycron

 


 

Also when does this  "0 */6 * * *" execute?

Every 6 hours. http://www.thegeekstuff.com/2011/07/cron-every-5-minutes/ gives several examples of how to setup cron to run at any time you need.

 


 

If you would like a list of the available rsync options: http://www.evbackup.com/support-commonly-used-rsync-arguments/ should help. In my example, I used "-avz" for archive, verbose, compressed (zipped). Those are common, but wanted you to be aware of the options in case the ones I listed do not fit your exact needs.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.