Skip to main content

Overview

MoneyPrinter V2 includes a built-in CRON scheduler (src/cron.py) that enables fully automated content generation and posting. Schedule your YouTube Shorts and Twitter posts to run at specific intervals without manual intervention.

How Scheduling Works

The CRON script accepts three key parameters:
  1. Purpose: Which platform to post to (twitter or youtube)
  2. Account UUID: Which account to use for posting
  3. Ollama Model: Which LLM model to use for content generation
The script then:
  • Retrieves account configuration from cache
  • Generates content using the specified LLM model
  • Posts/uploads to the target platform
  • Logs the operation for monitoring

Setting Up CRON Jobs

Prerequisites

Before scheduling automated tasks:
  1. Configure at least one account (see Account Setup)
  2. Note the account UUID (visible when selecting accounts)
  3. Install and configure Ollama with at least one model
  4. Test manual posting to ensure everything works

CRON Job Syntax

Basic CRON syntax:
┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of month (1 - 31)
│ │ │ ┌───────────── month (1 - 12)
│ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday)
│ │ │ │ │
* * * * * command to execute

Common Schedule Examples

0 * * * * cd /path/to/MoneyPrinterV2 && source venv/bin/activate && python src/cron.py twitter YOUR_UUID llama3.2:3b
Runs at the start of every hour (e.g., 1:00, 2:00, 3:00)
0 */6 * * * cd /path/to/MoneyPrinterV2 && source venv/bin/activate && python src/cron.py youtube YOUR_UUID llama3.2:3b
Runs every 6 hours (e.g., 00:00, 06:00, 12:00, 18:00)
0 9,21 * * * cd /path/to/MoneyPrinterV2 && source venv/bin/activate && python src/cron.py twitter YOUR_UUID mistral
Runs at 9:00 AM and 9:00 PM every day
30 14 * * * cd /path/to/MoneyPrinterV2 && source venv/bin/activate && python src/cron.py youtube YOUR_UUID llama3.2:3b
Runs every day at 2:30 PM
0 9-17 * * 1-5 cd /path/to/MoneyPrinterV2 && source venv/bin/activate && python src/cron.py twitter YOUR_UUID phi3
Runs every hour from 9 AM to 5 PM, Monday through Friday
0 10 * * 6,7 cd /path/to/MoneyPrinterV2 && source venv/bin/activate && python src/cron.py youtube YOUR_UUID llama3.2:3b
Runs at 10:00 AM on Saturdays and Sundays

Platform-Specific Scheduling

Twitter Scheduling

The Twitter automation flow:
  1. Loads account configuration from cache
  2. Initializes Twitter automation with Firefox profile
  3. Generates tweet content using Ollama
  4. Posts tweet to Twitter/X
Command structure:
python src/cron.py twitter <ACCOUNT_UUID> <OLLAMA_MODEL>
Example:
# Post a tweet every 2 hours
0 */2 * * * cd /path/to/MoneyPrinterV2 && source venv/bin/activate && python src/cron.py twitter 660e9500-f39c-52e5-b827-557766551111 llama3.2:3b

YouTube Scheduling

The YouTube automation flow:
  1. Loads account configuration from cache
  2. Initializes YouTube automation with Firefox profile
  3. Generates video script using Ollama
  4. Creates video with TTS and visuals
  5. Uploads video to YouTube Shorts
Command structure:
python src/cron.py youtube <ACCOUNT_UUID> <OLLAMA_MODEL>
Example:
# Upload a YouTube Short twice daily
0 10,18 * * * cd /path/to/MoneyPrinterV2 && source venv/bin/activate && python src/cron.py youtube 550e8400-e29b-41d4-a716-446655440000 llama3.2:3b
YouTube Shorts generation can take several minutes. Avoid scheduling too frequently to prevent overlapping jobs.

Implementation Guide

Linux/macOS Setup

  1. Find your account UUID:
    python src/main.py
    # Select Twitter Bot or YouTube Shorts Automater
    # Note the UUID from the accounts table
    
  2. Open crontab editor:
    crontab -e
    
  3. Add your scheduled jobs:
    # Twitter bot - posts every 3 hours
    0 */3 * * * cd /home/user/MoneyPrinterV2 && source venv/bin/activate && python src/cron.py twitter YOUR_TWITTER_UUID llama3.2:3b >> /tmp/mpv2_twitter.log 2>&1
    
    # YouTube - uploads daily at 2 PM
    0 14 * * * cd /home/user/MoneyPrinterV2 && source venv/bin/activate && python src/cron.py youtube YOUR_YOUTUBE_UUID llama3.2:3b >> /tmp/mpv2_youtube.log 2>&1
    
  4. Save and exit (in vim: :wq, in nano: Ctrl+X then Y)
  5. Verify scheduled jobs:
    crontab -l
    

Windows Setup

  1. Open Task Scheduler (search in Start Menu)
  2. Click “Create Basic Task”
  3. Name: “MPV2 Twitter Bot” (or similar)
  4. Trigger: Choose frequency (Daily, Weekly, etc.)
  5. Action: “Start a program”
  6. Program: Path to Python in your venv
    C:\Users\YourName\MoneyPrinterV2\venv\Scripts\python.exe
    
  7. Arguments:
    src/cron.py twitter YOUR_UUID llama3.2:3b
    
  8. Start in: Path to MoneyPrinterV2 directory
    C:\Users\YourName\MoneyPrinterV2
    
  9. Finish and enable the task

Best Practices

Frequency Recommendations

Twitter

Recommended: 3-8 times per dayAvoid posting more than once per hour to prevent spam flags.

YouTube Shorts

Recommended: 1-3 times per dayVideo generation takes time. Space uploads at least 6 hours apart.

Logging and Monitoring

Add logging to your CRON jobs for debugging:
# Append stdout and stderr to log files
0 */3 * * * cd /path/to/MoneyPrinterV2 && source venv/bin/activate && python src/cron.py twitter UUID MODEL >> /var/log/mpv2_twitter.log 2>&1
Monitor logs regularly:
# View recent Twitter bot logs
tail -f /var/log/mpv2_twitter.log

# View recent YouTube automation logs
tail -f /var/log/mpv2_youtube.log

Error Handling

The CRON script includes basic error handling:
  • Missing UUID: Exits with error message
  • Account not found: Exits gracefully
  • Ollama model not specified: Exits with error
Consider adding email notifications for failures:
# Send email on failure (requires mailutils)
0 */3 * * * cd /path/to/MoneyPrinterV2 && source venv/bin/activate && python src/cron.py twitter UUID MODEL || echo "MPV2 Twitter job failed" | mail -s "CRON Failure" [email protected]

Environment Considerations

When running scheduled jobs, ensure:
  • Virtual environment is activated
  • Working directory is set to project root
  • Environment variables (like GEMINI_API_KEY) are available
  • Firefox profiles are accessible
  • No conflicting manual operations are running

Multiple Account Scheduling

You can schedule different accounts at different times:
# Account 1: Tech content, posts every 4 hours
0 */4 * * * cd /path/to/MoneyPrinterV2 && source venv/bin/activate && python src/cron.py twitter UUID_1 llama3.2:3b

# Account 2: Finance content, posts every 6 hours with 2-hour offset
0 2,8,14,20 * * * cd /path/to/MoneyPrinterV2 && source venv/bin/activate && python src/cron.py twitter UUID_2 mistral

# Account 3: Gaming YouTube, uploads daily at 3 PM
0 15 * * * cd /path/to/MoneyPrinterV2 && source venv/bin/activate && python src/cron.py youtube UUID_3 llama3.2:3b

Troubleshooting

Check:
  1. Verify CRON service is running: systemctl status cron (Linux)
  2. Check crontab syntax: crontab -l
  3. Review system logs: grep CRON /var/log/syslog
  4. Ensure absolute paths are used
Solution:
  1. Add output redirection: >> /tmp/mpv2.log 2>&1
  2. Check log file for error messages
  3. Test command manually from terminal
  4. Verify virtual environment activation
Solution:
  • Ensure Firefox is not running when CRON job executes
  • Use separate Firefox profiles for different accounts
  • Check file permissions on profile directories
Solution:
  1. Verify model is installed: ollama list
  2. Check model name spelling in CRON command
  3. Ensure Ollama service is running: systemctl status ollama
Solution:
  1. Verify UUID in cache files: .mp/twitter.json or .mp/youtube.json
  2. UUIDs are case-sensitive - copy exactly as shown
  3. Ensure cache files have correct permissions

Testing Your Schedule

Before setting up production schedules, test manually:
# Navigate to project directory
cd /path/to/MoneyPrinterV2

# Activate virtual environment
source venv/bin/activate  # Linux/macOS
# or
venv\Scripts\activate  # Windows

# Test Twitter posting
python src/cron.py twitter YOUR_TWITTER_UUID llama3.2:3b

# Test YouTube upload
python src/cron.py youtube YOUR_YOUTUBE_UUID llama3.2:3b
If manual execution works, the scheduled version should work too.

Advanced Scheduling

Dynamic Model Selection

Rotate between different models for variety:
# Morning posts use llama3.2:3b
0 9 * * * python src/cron.py twitter UUID llama3.2:3b

# Evening posts use mistral
0 21 * * * python src/cron.py twitter UUID mistral

Rate Limiting

Preventing platform rate limits:
# Stagger posts across the day
0 9,12,15,18,21 * * * python src/cron.py twitter UUID llama3.2:3b

Conditional Execution

Run only during specific conditions:
# Only run if internet connection is available
*/30 * * * * ping -c1 google.com > /dev/null && cd /path/to/MPV2 && python src/cron.py twitter UUID MODEL

Next Steps

Configuration Settings

Optimize settings for scheduled operations

Account Management

Manage multiple accounts for scheduling

Build docs developers (and LLMs) love