I am a complete noob at shell scripting. I have a business that wants record after hours activity via dgital wifi security camera's due to theft.
I devised a method that would use DCS 5300G IP cameras to upload their data to an off-site location via
FTP.
This works but now, I am having some issues with the crontab commands I have setup to create a daily archive of the data via the web hosting company's cPanel. Unfortunately, the webhosting company's support team is not able to decipher the crontab(so they say) to troubleshoot the issue.
How can I turn this all in to a shell script that can run against each directory of files and perform the same steps outlined below.
I created the following entries:
- 0 9 * * *
this stands for run every day at 9am, based on the server's time
- This command will zip all .jpg files found in the path: /home/nrrcom43/public_ftp/
tarcam/tbs
-cam-1FL
- 0 9 03 * * *
this stands for run every day at 9:03am, based on the server's time
- This command will delete all .jpg files in the path rm /home/nrrcom43/public_ftp/
tarcam/tbs
-cam-1FL
- 0 9 06 * * *
this stands for run every day at 9:06am, based on the server's time
- This command will move the .zip file from the /home/nrrcom43/public_ftp/
tarcam/tbs
-cam-1FL directory to /home/nrrcom43/public_ftp/
tarcam/tbs
-cam-archi
ves
mv /home/nrrcom43/public_ftp/
tarcam/tbs
-cam-1FL/t
bs-cam1FL.
zip /home/nrrcom43/public_ftp/
tarcam/tbs
-cam-archi
ves
- 0 9 09 * * *
this stands for run every day at 9:09am, based on the server's time
- This command will execute a shell script which will append today's date to the zip file that was moved in the previous step above. This script was tested by one of your techs in this ticket but it is not running properly from my crontab.
sh /home/nrrcom43/public_ftp/
tarcam/tbs
-cam-archi
ves/addDat
e.sh /home/nrrcom43/public_ftp/
tarcam/tbs
-cam-archi
ves/tbs-ca
m-1FL.zip
- 0 9 12 * * *
this stands for run every day at 9:12am, based on the server's time
- This command will zip all .jpg files found in the path: /home/nrrcom43/public_ftp/
tarcam/tbs
-cam-2FL
- 0 9 15 * * *
this stands for run every day at 9:15am, based on the server's time
- This command will delete all .jpg files in the path rm /home/nrrcom43/public_ftp/
tarcam/tbs
-cam-2FL
- 0 9 18 * * *
this stands for run every day at 9:18am, based on the server's time
- This command will move the .zip file from the /home/nrrcom43/public_ftp/
tarcam/tbs
-cam-2FL directory to /home/nrrcom43/public_ftp/
tarcam/tbs
-cam-archi
ves
mv /home/nrrcom43/public_ftp/
tarcam/tbs
-cam-2FL/t
bs-cam2FL.
zip /home/nrrcom43/public_ftp/
tarcam/tbs
-cam-archi
ves
- 0 9 21 * * *
this stands for run every day at 9:21am, based on the server's time
- This command will execute a shell script which will append today's date to the zip file that was moved in the previous step above. This script was tested by one of your techs in this ticket but it is not running properly from my crontab.
sh /home/nrrcom43/public_ftp/
tarcam/tbs
-cam-archi
ves/addDat
e.sh /home/nrrcom43/public_ftp/
tarcam/tbs
-cam-archi
ves/tbs-ca
m-2FL.zip
Start Free Trial