print "Starting Toodledo archive..." username='testUsername' password='notAPassword' localTargetDirectory='C:/data/backups' localTmpSpace='C:/data/tmp' wgetcookies export MYCOOK=$MYTEMP/wgetcookies.txt # # MYWGET is path and params to pass to wget # the no check certificate is required to connect over https export MYWGET="/usr/local/bin/wget --quiet --no-check-certificate --save-cookies $MYCOOK --load-cookies $MYCOOK " export MYLOG=$MYBACK/toodledo-backup.log export TS=`date '+%Y%m%d%H%M%S'` echo "$TS toodledo backup init" >> $MYLOG cd $MYTEMP >> $MYLOG 2>&1 $MYWGET -O /dev/null --post-data "email=$MYUSER&pass=$MYPASS" https://www.toodledo.com/signin.php >> $MYLOG 2>&1 $MYWGET -O $MYBACK/$TS.toodledo-tasks.xml https://www.toodledo.com/xml.php >> $MYLOG 2>&1 $MYWGET -O $MYBACK/$TS.toodledo-notes.csv https://www.toodledo.com/csv_notes.php >> $MYLOG 2>&1 $MYWGET -O $MYBACK/$TS.toodledo-activity.html https://www.toodledo.com/activity.php >> $MYLOG 2>&1 # # check for empty zero length files, write to log and email $MYUSER on errors # for FILE in \ $MYBACK/$TS.toodledo-tasks.xml \ $MYBACK/$TS.toodledo-notes.csv \ $MYBACK/$TS.toodledo-activity.html do [[ -s $FILE ]] || echo "$TS FAIL empty file $FILE" >> $MYLOG 2>&1 [[ -s $FILE ]] || echo "$TS FAIL empty file $FILE" | mail -s "toodledo backup error" $MYUSER >> $MYLOG 2>&1 done rm $MYCOOK >> $MYLOG 2>&1 '''
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question