mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-03 12:19:02 +00:00
Updated Scheduling exports with Mono & Crontab (markdown)
@@ -24,10 +24,8 @@ if [[ "$TOKENTYPE" == "BOT" ]]; then
|
|||||||
ISBOTYES=-b
|
ISBOTYES=-b
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PATH=/Library/Frameworks/Mono.framework/Versions/Current/bin/:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
|
|
||||||
CURRENTTIME=`date +"%Y-%m-%d-%H-%M-%S"`
|
|
||||||
mono DiscordChatExporter.Cli.exe -t $TOKEN $ISBOTYES -c $CHANNEL -f $EXPORTFORMAT -o exporttmp
|
mono DiscordChatExporter.Cli.exe -t $TOKEN $ISBOTYES -c $CHANNEL -f $EXPORTFORMAT -o exporttmp
|
||||||
|
CURRENTTIME=`date +"%Y-%m-%d-%H-%M-%S"`
|
||||||
if [[ "$EXPORTFORMAT" == "PlainText" ]]; then
|
if [[ "$EXPORTFORMAT" == "PlainText" ]]; then
|
||||||
mv "exporttmp" $EXPORTDIRECTORY/$FILENAME-$CURRENTTIME.txt
|
mv "exporttmp" $EXPORTDIRECTORY/$FILENAME-$CURRENTTIME.txt
|
||||||
|
|
||||||
@@ -62,7 +60,7 @@ exit
|
|||||||
|
|
||||||
**5.** Add a new job to crontab using `sudo crontab –e`
|
**5.** Add a new job to crontab using `sudo crontab –e`
|
||||||
|
|
||||||
**6.** Add `* * * * * /path/to/DiscordChatExporter/cron.sh >/tmp/discordexporter.log 2>/tmp/discordexportererror.log` to the end of the file.
|
**6.** Add `* * * * * /path/to/DiscordChatExporter/cron.sh` to the end of the file.
|
||||||
|
|
||||||
Replace the *s according to:
|
Replace the *s according to:
|
||||||
|
|
||||||
@@ -75,8 +73,6 @@ Week starts on Sunday. 0 = SUN, 1 = MON...
|
|||||||
|
|
||||||
Filename date format is YYYY-MM-DD-hh-mm-ss.
|
Filename date format is YYYY-MM-DD-hh-mm-ss.
|
||||||
|
|
||||||
The cron file is located at `/usr/lib/cron/tabs` on macOS, and at `/var/spool/cron/crontabs` on Linux, but should always be edited with `crontab -e`.
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
||||||
**Examples**
|
**Examples**
|
||||||
|
|||||||
Reference in New Issue
Block a user