Community discussions

MikroTik App
 
User avatar
own3r1138
Long time Member
Long time Member
Topic Author
Posts: 681
Joined: Sun Feb 14, 2021 12:33 am
Location: Pleiades
Contact:

An issue with scripting/scheduler for container mount backup

Fri Feb 10, 2023 3:35 pm

Hi,
I have an issue using the scheduler for this script. Is this something that MT should fix? Or perhaps this is an access/permission issue?

This script works when running it manually or via the terminal. However, the scheduler can't run the script.
2023-02-08_17-34-07.jpg
CLI
/system scheduler
add interval=8h name=container-nginx-backup on-event="/system script run container-nginx-backup" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-time=startup
add dont-require-permissions=no name=container-nginx-backup owner=user policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=":log info \"Nginx-Backup started\"\r\
    \n\r\
    \n:log info \"DATABASE\"\r\
    \n\r\
    \n/tool fetch address=\"ip\" src-path=\"/pcie1-part1/containers/mounts/nginx-proxy/data/database.sqlite\" user=\"user\" mode=\"ftp\" password=\"pw\" dst-path=\"mounts/nginx-proxy/data/database.sqlite\" upload\
    =yes;\r\
    \n\r\
    \n\r\
    \n:log info \"Nginx-Backup finished\""

You do not have the required permissions to view the files attached to this post.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: An issue with scripting/scheduler for container mount backup

Fri Feb 10, 2023 3:53 pm

You stop the use of the file before backup it?
 
User avatar
own3r1138
Long time Member
Long time Member
Topic Author
Posts: 681
Joined: Sun Feb 14, 2021 12:33 am
Location: Pleiades
Contact:

Re: An issue with scripting/scheduler for container mount backup

Fri Feb 10, 2023 3:57 pm

Hi,
No, it's a running container. Additionally, It did work when I ran the script manually without the need to stop the container.

update
I stopped the container first and tested the scheduler. It shows the same behavior as before.


workaround
Add another script to run the first script and then the scheduler to run the second script.

Who is online

Users browsing this forum: astelsrl and 9 guests