Scripts (new threads)http://smanager.wikidot.com/forum/c-573814/scripts
Threads in the forum category "Scripts" - Come to this category to share your own scripts. Please add at least a short description.Tue, 20 Mar 2018 02:20:49 +0000http://smanager.wikidot.com/forum/t-2191831Running a .bat filehttp://smanager.wikidot.com/forum/t-2191831/running-a-bat-file
Fri, 31 Mar 2017 13:03:39 +0000geraldinejns3035268
Can I run a test.bat file using SManager on my android tablet. I've installed Root Checker, Kingroot. I've also installed SMWidgets, and SManager. I've played around inside but cannot seem to run the file. Below is what i'm trying to run.

First of all: THANK YOU VERY MUCH FOR THIS MASTERPIECE OF SOFTWARE! Great!!!

I installed SManager and SMExternalSD on external SDcard.

I am using an ASUS MeMO Pad 7 (ME176CX) with Lollipop Android 5.0 (second update via ASUS support site). In the SDcard slot there is an Samsung 64GB SDcard. First partition is a FAT 32, second is a ext4. Both are aligned and roughly of the same size. The second partition is empty (beside the lost+found folder). With SManager I want to create a script which mounts the second partion under /Removable/sdext, where sdext is the mount point and has to be created by the script.

the mode for chmod and the ownership of sdext are the same as for the folder "MicroSD" on the same level which holds the first partition of the external sdcard.

Everything works fine…but chown/chmod are ignored or the permissions/onwerships get resetted somehow. Only with an root-enabled browser like x-plore I can access the contents of sdext.

How can I make the whole script working?

Thank you very much in advance for any help! Best regards, tuxic

]]>
http://smanager.wikidot.com/forum/t-1044410new scripthttp://smanager.wikidot.com/forum/t-1044410/new-script
Unable to find existing scriptSat, 25 Oct 2014 18:39:18 +0000faiz
Hi, I am new to smanager. First thing i did , clicked on new script and made one with some rhandom name… Now i am not able to find where my script is. When i click on browser , i cant find anything in sdcard0. However when i try to create the script with same name , it gives an error that file already exists.. Plz let me know where to find thia file. M sorry if i am truoubling as i am noob.
]]>
http://smanager.wikidot.com/forum/t-818632Scheduler: Why WAKE_LOCK (want to run when Power On)http://smanager.wikidot.com/forum/t-818632/scheduler:why-wake-lock-want-to-run-when-power-on
I want to schedule a script at midnight. Can i make it delay until the screen is turned on?Sat, 15 Mar 2014 21:10:53 +0000Kristian
Hi, for a self made photo calendar, i want to run a very little script that copies the appropriate daily image every day at midnight to another location, where a photo frame app finds it. To enable the run at midnight i have understood that i shall permit WAKE_LOCK. But i don't want to keep the phone powered on for this one script. It would be best, if the scheduler would realize in the morning, at power on, that there is a pending operation, and then execute this operation, meaning my scheduled script. If i remember correctly, the original linux cron does work this way. Did i miss an option? thank you and kind regards from Germany Kristian
]]>
http://smanager.wikidot.com/forum/t-684599Randomfilehttp://smanager.wikidot.com/forum/t-684599/randomfile
A simple script that copies a random file from a directory and saves it on another dir with a standard name. Useful for random ringtones and wakeup songs!Sat, 17 Aug 2013 14:25:59 +0000UranyaHi friends,

I have created this little script that chooses a random file from a directory and copies it to another dir. I use it to have a different wakeup song every day! It works great, try it :)

But does not work when I try to run the script. If I run the command in terminal ide it works though. Any help getting this to work would be awesome.

Thanks, Cdub

]]>
http://smanager.wikidot.com/forum/t-584435Use rsync to download new files to your android devicehttp://smanager.wikidot.com/forum/t-584435/use-rsync-to-download-new-files-to-your-android-device
Fri, 09 Nov 2012 00:59:21 +0000Jay
This is an rsync shell script that I wrote to keep a directory of music files in sync between my Linux server/workstation and my android device. The script simply downloads any files which it doesn't already have, and deletes files which have been deleted from the server.

The server here must be running an ssh/scp daemon, and I use ssh key authentication. I don't document how to set up ssh key authentication here, as that is well documented elsewhere.

Most of this script is actually the process of making sure that the sync worked correctly, and it will retry until it succeeds, up to a maximum of six tries. This is because my wifi often goes out during long transfers, and the rsync process fails. The script will run in a loop for as many times as it is configured, until it succeeds or gives up.

Finally, I run this script with a push of a button, by setting up an SMWidget to run the script. This makes it very convenient to run.

Note that I used "rsync -rltD" instead of "rsync -a", because the -p argument was causing trouble for me. This is because my sdcard is FAT filesystem, which does not support posix file permissions, and thus rsync was giving me trouble about it.

This is a small backup script I wrote for my Nexus One phone. I am using Cyanogenmod 7.2 at this time.

I use SSHDroidPro as an ssh/scp server and I regularly log into my phone over wireless to manage files and do other tasks. SManager makes it easy to run the scripts I create via the phone's GUI, browse and manage files, and schedule jobs to run (like cron would).

This script runs via the default shell and the syntax should be portable without too much trouble. It requires a modern version of rsync, busybox, netcfg, and dumpstate. It uses ssh key authentication for the remote access. I don't document how to create or configure ssh keys here, as that is well-known information you can get from any search engine.

I have configured this script to run via SManager's built-in scheduling tool. I have the script configured to run once a week, each night while I am sleeping. I assume that my device is being charged and has wifi access to my access point during that time.

My use of dumpstate, and how I check wifi access and AC/USB power may not work on other devices. I have added comments at these locations to point them out.

It is very likely that some paths will need to be modified to be appropriate for your device, but it should be pretty obvious. You will definitely want to test this before assuming it will work for you.

Rsync will keep a backup of all files in the destination "current" directory, and during each backup, will keep a copy of the changed files in an "RSYNC-BAK" directory. These RSYNC-BAK directories need to be cleaned up on the destination host, unless you want them to build up forever.

I currently don't have the rsync process set retry if the first backup attempt fails, but I am likely to add this feature later, as I've already added it to another one of my rsync scripts.

The script takes a single argument; the word "scheduled" or "manual".

"rsync-backup.sh scheduled" is for the automated backup and will check to make sure that my device is not running on battery power, and that it has 802.11/wifi access. This prevents the script from running in case I am not home. Otherwise, it might drain the battery, and it could run over my carrier network, which I don't want to happen.

"rsync-backup.sh manual" is for when I manually want to run the script. It simply skips the wifi and power check.

The first time you run the script, it may take a LONG time to finish, as your entire filesystem must be transferred. However, subsequent backups only uploads new files and will be much faster. It might be a good idea to copy your filesystem directly via USB to make the initial backup.

Finally, I only wrote this script in the last two weeks. It may have bugs that I have yet to discover.

I am happy to reply to intelligent comments and questions, but I won't address linux-noob-101 stuff that google can tell you.