Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jabbalaci/Copy-Queue
A command line "cp" and "mv" that use a queue.
https://github.com/jabbalaci/Copy-Queue
Last synced: 2 days ago
JSON representation
A command line "cp" and "mv" that use a queue.
- Host: GitHub
- URL: https://github.com/jabbalaci/Copy-Queue
- Owner: jabbalaci
- Created: 2013-03-28T18:57:25.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-04-14T22:25:02.000Z (over 7 years ago)
- Last Synced: 2024-08-01T16:43:11.180Z (3 months ago)
- Language: Python
- Size: 7.81 KB
- Stars: 28
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- my-awesome-github-stars - jabbalaci/Copy-Queue - A command line "cp" and "mv" that use a queue. (Python)
README
Copy Queue
==========* Author: Laszlo Szathmary, 2013 ()
* Website:
* GitHub:A command line "cp" and "mv" that use a queue.
Warning! I don't take any responsibility for any loss of data.
Use these scripts at your own risk.Target operating systems: Unix/Linux. Tested with Python 2.7.
Usage
-----cpq file1 /trash/movies/
cpq file2 /trash/movies
mvq file3 /trash/movies/All the three files are put in a queue and only one is
processed at a given time.Motivation
----------If you launch the previous 3 commands with "cp" and "mv" in
the background, then all three will run concurrently, thus
your machine will slow down because of the I/O operations.
If you launch them in the foreground, then you have to wait
until one finishes and then you can start the next one.You can always use a graphical file manager that supports a
copy queue but I prefer to work in bash in combination with
the good old Midnight Commander. And in MC I didn't find this
feature.Installation
------------In the file `config.py` you can customize all the directory
and file paths. For an easier understanding, I will explain
the usage of the scripts with the default values.First, clone this project to the following directory:
`$HOME/python/Copy-Queue`.Then create the directory `$HOME/bin` and add these two
symbolic links:cd $HOME/bin
ln -s $HOME/python/Copy-Queue/cpq_mvq.py cpq
ln -s $HOME/python/Copy-Queue/cpq_mvq.py mvqMake sure that `$HOME/bin` is in your `PATH`.
Finally, create the directory `$HOME/bin/copy_queue`.
Now you are ready to use "cpq" and "mvq".
Tips
----If there is a directory where you copy/move very often, then
you can add this directory to your `.bashrc` file. For instance,
I copy a lot of videos to my Android phone, thus I created the
following shortcut in my `.bashrc`:# Android's Video directory
A='/media/jabba/2B9A-EB28/Video'
export AThen I can copy videos to my Android this way:
cpq movie.avi $A
Another tip: the scripts create a log file. If you want to see
the copy/move progress, create the following alias:alias Q='tail -f $HOME/bin/copy_queue/daemon.log'
To check if the tasks are finished, just launch `Q`:
$ Q
Update (20170415)
-----------------I found today a simple Unix batch system called
task spooler ([AUR](https://aur.archlinux.org/packages/task-spooler/),
[PPA](https://launchpad.net/ubuntu/+source/task-spooler)).
Task spooler is more general than my approach since you can send
any Unix command in its queue. Task spooler is a better solution
than mine. It also provides more options, so I suggest using task spooler.
Here is a short video about its usage: .