forked from trickortweak/flickr-uploader
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathuploadr.cron
executable file
·45 lines (38 loc) · 1.4 KB
/
uploadr.cron
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh
# by oPromessa, 2017, V2.5
#
# Shell Script file to be called by cron or Synology Task Scheduler
# For use with https://github.com/oPromessa/flickr-uploader
#
# Python PREFIX Folder: Adjust as appropriate to your system
PREFIX=~/apps/Python
# Update PATH to include PREFIX/bin where uploadr.py is installed via PIP
PATH=$PATH:${PREFIX}/bin
# Edit line to to reference folder where uploadr.py is located when mannually
# installed. Also where logs will be saved.
FOLDER=~/apps/flickr-uploader-2.8.6
# Compatible with different installation modes of uploadr.py: PIP or Mannual
RUNCMD=`which uploadr.py`
RUNCMD=${RUNCMD:=$FOLDER/uploadr.py}
# I've used this setting to allow support for international characters in
# folders and file names
export LC_ALL=en_US.utf8
export LANG=en_US.utf8
# Adjust as appropriate to your system
export PYTHONPATH=${PREFIX}/lib/python2.7/site-packages
# Some Logging...
echo Start
date +"[%F %T] Start ----"
# Set parameters as appropriate to your system
python2.7 $RUNCMD -v -b -p 10 >>$FOLDER/uploadr.out 2>>$FOLDER/uploadr.err
echo Result: $?
echo End
date +"[%F %T] End ----"
echo --------- uploadr.err
[ -f $FOLDER/logs/uploadr.err ] && tail -20 $FOLDER/logs/uploadr.err
echo --------- uploadr.out
[ -f $FOLDER/logs/uploadr.out ] && tail -100 $FOLDER/logs/uploadr.out
echo ---------
echo ---------
echo Further output on file: $FOLDER/uploadr.out and $FOLDER/uploadr.err
echo ---------