Skip to content
NeonStudios-devPublic

About

Generate Random data files for testing backup system or something

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

gen_data.py

A Python script that generates random files and folders for backup testing. Supports local generation, remote generation directly on a server via SSH/SFTP, or both at once.

Requirements

Python 3.6+ is required. For SSH support, install paramiko:

pip install paramiko

Usage

Local

Generate files on your local machine:

python3 gen_data.py
python3 gen_data.py --output ~/test_data --size 100
python3 gen_data.py --output ~/test_data --total-mb 500

Remote (SSH)

Generate files directly on a remote server — nothing is written locally:

python3 gen_data.py --ssh user@host --remote-path /home/user/test_data
python3 gen_data.py --ssh user@host --port 2222 --remote-path /home/user/test_data --size 100
python3 gen_data.py --ssh user@host --remote-path /tmp/data --total-mb 200

Both

Generate locally and on the remote server in one run:

python3 gen_data.py --output ./local --ssh user@host --remote-path /tmp/data --size 50

Options

Flag Default Description
--output none Local output directory. Omit to skip local generation.
--size 50 Number of files to generate.
--total-mb none Target total size in MB. Overrides --size.
--depth 3 Maximum folder nesting depth.
--seed none Random seed for reproducible output.
--ssh none Remote host in user@host format.
--port 22 SSH port.
--remote-path /tmp/test_data Path on the remote server to generate files in.
--ssh-key none Path to SSH private key. Falls back to agent/default keys.
--password false Prompt for SSH password instead of key auth.

File Types Generated

Type Extensions
Text .txt .md .log .csv .json .xml .ini .yaml
Code .py .sh .js .html .css
Binary .bin .dat .db

Examples

# 100 files locally
python3 gen_data.py --size 100 --output ~/test_data

# 1 GB directly on a remote server over SSH
python3 gen_data.py --ssh flame@192.168.1.10 --port 22 --remote-path /home/flame/test_data --total-mb 1024

# Reproducible run with a fixed seed
python3 gen_data.py --size 50 --seed 42 --output ~/test_data

# Remote with a specific key
python3 gen_data.py --ssh flame@192.168.1.10 --ssh-key ~/.ssh/id_ed25519 --remote-path /tmp/data --size 200

# Remote with password auth
python3 gen_data.py --ssh flame@192.168.1.10 --remote-path /tmp/data --password

Notes

  • Remote directories are created automatically if they don't exist.
  • When using --total-mb, a progress bar shows live MB written and file count.
  • When no --output or --ssh is provided, defaults to generating 50 files in ./test_data.

About

Generate Random data files for testing backup system or something

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages