This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:raspberry:picam:scripts:copyjob [2015/06/05 14:54] – lunetikk | linux:raspberry:picam:scripts:copyjob [2019/01/09 18:53] (current) – lunetikk | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== Copyjob ===== | ===== Copyjob ===== | ||
| - | This script copies all your .jpg and .avi captures to a mounted NAS. Before it does so, it will check if there is a directory with the date of today. If it doesnt exist it will create one with the subdirectories " | + | This script copies all your .jpg and .avi captures to a mounted NAS. Before it does so, it will check if there is a directory with the date of today. If it doesnt exist it will create one with the subdirectories " |
| - | \\ | + | \\ \\ |
| First mount your NAS. | First mount your NAS. | ||
| - | \\ | + | \\ \\ |
| - | < | + | [[linux: |
| - | mount -t cifs // | + | \\ \\ |
| - | </ | + | Second create a file named "copyjob.sh" with the code below |
| - | Make sure you can access it and that you can see files. If you already have files at "%%//%%192.168.178.xxx/ | + | |
| - | Also create a file with <code>touch / | + | |
| - | < | + | < |
| #!/bin/bash | #!/bin/bash | ||
| DATE=`date +%d_%m_%Y` | DATE=`date +%d_%m_%Y` | ||
| Line 38: | Line 36: | ||
| </ | </ | ||
| - | Make sure you use < | + | Make sure you use < |
| Create a cronjob for it by inserting the following line to the end in< | Create a cronjob for it by inserting the following line to the end in< | ||
| The job will be executed everytime the clock hits 0 minutes (for example 1:00pm 2.00am...) | The job will be executed everytime the clock hits 0 minutes (for example 1:00pm 2.00am...) | ||
| + | |||
| + | ==== Troubleshooting ==== | ||
| + | |||
| + | If the copyjob fails because of "too many arguments" | ||
| + | <code bash> | ||
| + | find $BASEPATH -name " | ||
| + | </ | ||
| + | |||
| + | Like this: | ||
| + | |||
| + | <code bash> | ||
| + | find $BASEPATH -name " | ||
| + | sleep 10 | ||
| + | find $BASEPATH -name " | ||
| + | sleep 10 | ||
| + | find $COPYPATH -name " | ||
| + | sleep 10 | ||
| + | find $COPYPATH -name " | ||
| + | sleep 10 | ||
| + | </ | ||
| + | |||
| + | \\ | ||
| + | \\ | ||
| + | ~~DISCUSSION: | ||