mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-07 14:10:10 +00:00
Formatting and noob friendlier
@@ -4,7 +4,8 @@ You can use Cron on macOS, but [this method](https://github.com/Tyrrrz/DiscordCh
|
||||
|
||||
#
|
||||
|
||||
**1.** Open Terminal and create a new text file with `nano /path/to/DiscordChatExporter/cron.sh`
|
||||
**1.** Open Terminal and create a new text file with `nano /path/to/DiscordChatExporter/cron.sh`<br/>
|
||||
> For beginners: You can't use your mouse in nano, use the arrow keys to control the cursor (caret).
|
||||
|
||||
**2.** Paste the following into the text file:
|
||||
|
||||
@@ -67,26 +68,23 @@ exit 0
|
||||
|
||||
**3.** Replace:
|
||||
|
||||
`tokenhere` with your [Token](https://github.com/Tyrrrz/DiscordChatExporter/wiki/Obtaining-Token-and-Channel-IDs)
|
||||
|
||||
`bot/user` If the Token is from a bot, replace it with `bot`. If it's from a user, `user`
|
||||
|
||||
`channelhere` with a [Channel ID](https://github.com/Tyrrrz/DiscordChatExporter/wiki/Obtaining-Token-and-Channel-IDs)
|
||||
|
||||
`dceFOLDERpathhere` with DCE's **directory path** (e.g. `/path/to/folder`, NOT `/path/to/folder/DiscordChatExporter.dll`)
|
||||
|
||||
`filenamehere` with the exported channel's filename, without spaces
|
||||
|
||||
`dirhere` with the export directory (e.g. /home/user/Documents/Discord\ Exports)
|
||||
|
||||
`tokenhere` with your [Token](https://github.com/Tyrrrz/DiscordChatExporter/wiki/Obtaining-Token-and-Channel-IDs)<br/>
|
||||
`bot/user` If it's a bot token, replace it with `bot`. If it's from a user, `user`<br/>
|
||||
`channelhere` with a [Channel ID](https://github.com/Tyrrrz/DiscordChatExporter/wiki/Obtaining-Token-and-Channel-IDs)<br/>
|
||||
`dceFOLDERpathhere` with DCE's **directory path** (e.g. `/path/to/folder`, NOT `/path/to/folder/DiscordChatExporter.dll`)<br/>
|
||||
`filenamehere` with the exported channel's filename, without spaces<br/>
|
||||
`dirhere` with the export directory (e.g. /home/user/Documents/Discord\ Exports)<br/>
|
||||
`formathere` with one of the available export formats
|
||||
|
||||
**Remember to escape spaces** (add `\` before spaces) or to quote (") the paths (`"/home/user"`)!<br/><br/>
|
||||
**Remember to escape spaces** (add `\` before them) or to quote (") the paths (`"/home/my user"`)!<br/>
|
||||
|
||||
> For beginners: To save, hold down CTRL and then press O, if asked for a filename, type it and press ENTER. Hit CTRL+X to exit the text editor.<br/>
|
||||
[Check out this page](https://wiki.gentoo.org/wiki/Nano/Basics_Guide) if you want to know more about nano.
|
||||
|
||||
**4.** Make your script executable with `chmod +x /path/to/DiscordChatExporter/cron.sh`
|
||||
|
||||
**5.** Now let's edit the cron file. If you want to run the script with your user privileges, edit it by running `crontab -e`. If you want to run the script as root, edit it with `sudo crontab -e`.<br/>
|
||||
If it's your first time running this command, you might be asked to select a text editor.
|
||||
**5.** Let's edit the cron file. If you want to run the script with your user privileges, edit it by running `crontab -e`. If you want to run the script as root, edit it with `sudo crontab -e`.<br/>
|
||||
If this is your first time running this command, you might be asked to select a text editor. Nano is easier for beginners.
|
||||
|
||||
**6.** Add the following to the end of the file `* * * * * /path/to/DiscordChatExporter/cron.sh >/tmp/discordchatexporter.log 2>/tmp/discordchatexportererror.log`<br/>
|
||||
Don't forget to replace the `/path/to/DiscordChatExporter/cron.sh`!
|
||||
@@ -98,18 +96,12 @@ Then replace the *s according to:
|
||||
|
||||
#
|
||||
|
||||
**Examples**
|
||||
|
||||
If you want to execute the script at minute 15 of every hour: `15 * * * *`
|
||||
|
||||
Every 30 minutes `*/30 * * * *`
|
||||
|
||||
Everyday at midnight `0 0 * * *`
|
||||
|
||||
Everyday at noon `0 12 * * *`
|
||||
|
||||
Everyday at 3, 4 and 6 PM `0 15,16,18 * * *`
|
||||
|
||||
**Examples**<br/>
|
||||
If you want to execute the script at minute 15 of every hour: `15 * * * *`<br/>
|
||||
Every 30 minutes `*/30 * * * *`<br/>
|
||||
Everyday at midnight `0 0 * * *`<br/>
|
||||
Everyday at noon `0 12 * * *`<br/>
|
||||
Everyday at 3, 4 and 6 PM `0 15,16,18 * * *`<br/>
|
||||
Every Wednesday at 9 AM `0 9 * * 3`
|
||||
|
||||
Verify your cron time [here](https://crontab.guru).
|
||||
@@ -117,7 +109,7 @@ Verify your cron time [here](https://crontab.guru).
|
||||
#
|
||||
**Extra information**
|
||||
|
||||
The week starts on Sunday. 0 = SUN, 1 = MON...
|
||||
The week starts on Sunday. 0 = SUN, 1 = MON ... 7 = SUN.
|
||||
|
||||
Be aware that if you set the day to '31', the script will only run on months that have the 31th day.
|
||||
> 💡 Tip: [Learn more about running a cron job on the last day of the month here](https://stackoverflow.com/questions/6139189/cron-job-to-run-on-the-last-day-of-the-month) (expert).
|
||||
|
||||
Reference in New Issue
Block a user