pixel8383
Explorer
- Joined
- Apr 19, 2018
- Messages
- 80
Hello, I am trying to setup my .sh file in order to use the FreeNAS cron-managment GUI. I want to execute an rclone task inside a jail and save the stOut buffer to a variable that I will mail when the task is terminated.
Actually my code is the following:
It works pretty well if I execute this .sh file via SSH. When I try to start my cron, instead, I get the following error:
It seems like the cron process will get stuck when has to execute the $(jexec ...) command. It will not try to use the jail but tries to locate a global configuration (outside my rclone jail). This way the task cannot be executed.
What can I do to get the same result?
Thanks,
Emanuele
Actually my code is the following:
Code:
#!/bin/sh SOURCEPATH="MyFTP:/home/public_html/" DESTPATH=" /mnt/Backup/MyFTP/public_html/" FILTERS="- cache/supercache/**" MSG="Starting sync..." output="$MSG"$'\n'"$(jexec rclone rclone sync $SOURCEPATH $DESTPATH --filter "$FILTERS" -v 2>&1)" MSG="MyFTP SFTP sync completed" output="$output"$'\n'"$MSG" MSG="The scheduled task completed successfully" output="$output"$'\n'"$MSG" echo "$output" | mail -s "FreeNAS - RClone: MyFTP SFTP Sync" "<my-email>"
It works pretty well if I execute this .sh file via SSH. When I try to start my cron, instead, I get the following error:
Code:
Starting sync... 2018/06/22 17:12:11 NOTICE: Config file "/.config/rclone/rclone.conf" not found - using defaults 2018/06/22 17:12:11 Failed to create file system for "MyFTP:/home/public_html/": didn't find section in config file MyFTP SFTP sync completed The scheduled task completed successfully
It seems like the cron process will get stuck when has to execute the $(jexec ...) command. It will not try to use the jail but tries to locate a global configuration (outside my rclone jail). This way the task cannot be executed.
What can I do to get the same result?
Thanks,
Emanuele