Answer the question
In order to leave comments, you need to log in
How to run a cron script in a loop?
Good afternoon.
There is an elementary script for automatically downloading a fresh livecd cureit from the developer's ftp
#!/bin/bash
#Go to the desired directory
cd /media/d990ad00-6a5b-40ac-b171-6db0496c2a93/soft/_Antivirus/cureit
#Delete the old
rm file drweb-livecd -602.iso_old #Rename the
existing mv file
drweb-livecd-602.iso drweb-livecd-602.iso_old #Download
a new file
wget ftp://ftp.drweb.com/pub/drweb/livecd/drweb-livecd-.. .exit
0
When run by hand, it runs fine, but when adding a job to cron in the form of cd /home/ && sh dwnld.sh, for some unknown reason, it starts to continuously download and rewrite old files, instead of completing the script after downloading. CHADNT?
PS all this is running on the debian-based openmediavault distribution, the command to run the script is written via web-gui and it's impossible to see what line gets into crontab, crontab -e launched from the root produces emptiness.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question