Iocage Backup questions - Automation

Dellyjoe

Explorer
Joined
Jun 12, 2020
Messages
80
Hello everyone,
I have a question that came form this website, For me I don't really understand how to edit the code that is shown in the example, I know it looks simple but I need a little extra help... I always seem I need it.


I'm just simply trying to backup radarr, and this is for an example.

Code:
#!/bin/bash

echo "---Starting Backup of FreeNAS Jails---" >> /mnt/data/logs/Jail.log
echo $(date) >> /mnt/ssd/logs/Jail.log

#Jail #1 Backup
echo "Backing Up Jail" >> /mnt/data/logs/Jail.log
echo $(date) >> /mnt/data/logs/Jail.log
iocage stop [radarr] >> /mnt/data/logs/Jail.log
iocage export [radarr] >> /mnt/data/logs/Jail.log
iocage start [radarr] >> /mnt/data/logs/Jail.log
echo "...Deleting old backups" >> /mnt/data/logs/Jail.log
echo $(date) >> /mnt/data/logs/Jail.log
rm /mnt/Backups/[radarr]* >> /mnt/data/logs/Jail.log
echo "...Moving current backup to stotage folders" >> /mnt/data/logs/Jail.log
echo $(date) >> /mnt/data/logs/Jail.log
mv -v /mnt/[radarr]/iocage/images/[radarr]* /mnt/Backups/[radarr] >> /mnt/data/logs/Jail.log



The writer talks about replacing the file locations with the appropriate location, now what does that really mean, I have two Tanks named Tank1, and Tank2, the Iocage radarr is in Tank2, do i need to change it so it says /mnt/Tank2/data/logs/radarr.log

or do i need to create all these folders ? in my /mnt/Tank2?

Thank you for all the help,
Joe
 
Last edited:

Dellyjoe

Explorer
Joined
Jun 12, 2020
Messages
80
@garm Well I can make a folder for logs, but atm I really don't know,

But from your question it seems that I need to make a folder for the logs and then change the path and the script will make a log file at the end of the the export.

So I guess I will just make a folder where the logs can go into.
Does that make sense?

Joe
 

Dellyjoe

Explorer
Joined
Jun 12, 2020
Messages
80
Hey Everyone,

I gave this a shot and didn't have much luck, What am i doing wrong?


automatic_cron_Job.PNG

Here is the file that I want to run,

Next is the CRON job in GUI in freenas.

automatic_cron_Job_Scrips.PNG


is the CRON job being a text jail making it not able to run as a CRON?


let me know what you think, I'm really new at this so any advance would be great, this is just a test for one of my jails i have 6 more but will not create the file until I know it works.


Thank you for reading,
Joe
 

Dellyjoe

Explorer
Joined
Jun 12, 2020
Messages
80
figured it out by simplifying it and adding to the command line iocage stop Mineos; iocage export Mineos; iocage start Mineos;

Posting for other new users
Joe
 
Top