#!/usr/bin/python
#-*- coding: UTF-8 -*-
import os, shutil, fnmatch, time
path=os.path.expanduser("~")+'/Загрузки'
dest_path='/mnt/Torrents/'
while 1:
for _file in os.listdir(path):
if fnmatch.fnmatch(os.path.join(path, _file), '*.torrent'):
if not _file in os.listdir(dest_path):
shutil.move(os.path.join(path, _file), dest_path)
else: os.remove(os.path.join(path, _file))
time.sleep(20)
Тотже эффект если, поместить ссылку на скрипт в “ Система-Параметры-Запускаемые приложения”, автостарта нет. В последнем варианте syslog пишет:
Aug 12 21:33:47 comp gnome-session[1518]: WARNING: Could not launch application 'torr_find.py.desktop': Unable to start application: Произошёл сбой при выполнении процесса-потомка "/usr/bin/torr_find.py" (Отказано в доступе)
P.S dest_path='/mnt/Torrents/' находится на ntfs разделе, монтируется при старте перед запуском этого скрипта.