https://github.com/kidig/go-sdcopy
Command-line tool to copy & organize your media files from SD cards
https://github.com/kidig/go-sdcopy
copy sdcard tool
Last synced: 12 months ago
JSON representation
Command-line tool to copy & organize your media files from SD cards
- Host: GitHub
- URL: https://github.com/kidig/go-sdcopy
- Owner: kidig
- Created: 2025-01-05T03:18:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-06T04:27:10.000Z (over 1 year ago)
- Last Synced: 2025-02-24T16:41:55.304Z (over 1 year ago)
- Topics: copy, sdcard, tool
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SD Copy
SD Copy copies files from a source directory to a destination directory, preserving the directory structure and file timestamps.
It can be used for organizing destination files by date (see **Placeholders** below)
## Installation
1. Clone the repository:
```sh
git clone https://github.com/yourusername/sdcopy.git
cd sdcopy
```
2. Build the project:
```sh
go build -o sdcopy main.go
```
## Usage
Run the `sdcopy` command with the source and destination paths as arguments:
```sh
./sdcopy /path/to/source /path/to/destination
```
This will copy all files from /path/to/source to /path/to/destination, preserving the directory structure and file timestamps.
### Placeholders in Destination Path
You can use placeholders in the destination path to dynamically create directories based on the file's modification time. The following placeholders are supported:
* {year}: The year of the file's modification time (e.g., 2023)
* {month}: The month of the file's modification time (e.g., 01)
* {day}: The day of the file's modification time (e.g., 15)
For example:
```sh
./sdcopy /path/to/source /path/to/destination/{year}/{month}/{day}
```
If a file was modified on Jan 15, 2023, it will be copied to:
```sh
/path/to/destination/2023/01/15/filename
```