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 15:02] – lunetikk | linux:raspberry:picam:scripts:copyjob [2019/01/09 18:53] (current) – lunetikk | ||
---|---|---|---|
Line 2: | Line 2: | ||
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: | [[linux: | ||
- | \\ | + | \\ \\ |
Second create a file named " | Second create a file named " | ||
- | < | + | < |
#!/bin/bash | #!/bin/bash | ||
DATE=`date +%d_%m_%Y` | DATE=`date +%d_%m_%Y` | ||
Line 36: | 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: |